-
The
realpath()function gives you the file-system path, with any symbolic links and directory traversing (e.g. ../../) resolved. Thedirname()function gives you just the directory, not the file within it. -
__FILE__is a magic constant that gives you the filesystem path to the current .php file (the one that__FILE__is in, not the one it’s included by if it’s an include. -
Sounds about right.
-
This is to translate from Windows style (\) paths to Unix style (/).