I have the following code from Codeigniter index.php
My understanding is that,
If / of string position in $system_folder
__FILE__
The full path and filename of the file. If used inside an include, the name of the included file is returned. Since PHP 4.0.2, FILE always contains an absolute path with symlinks resolved whereas in older versions it contained relative path under some circumstances.
string dirname ( string $path )Given a string containing a path to a file, this function will return the name of the directory.
str_replace("\\", "/", $system_folder)
You need this to be consisten in path separators between different operating systems. Windows uses \ and *nix uses /, you keep with /.