nrg_alpha;10928782 wrote:I was initially thinking along similar lines, but with the use of FILE instead:
if( basename(__FILE__) == 'index.php' ) {
That will work, too, with the restriction that it must be in the main file -- if it's in an included file, then it will use the name of that include file.
Not to hijack this thread, but why does this magic constant utilise back slashes instead of forward slashes in the path?
I believe it will use whichever type of directory separator is native to the OS where it is running (back-slash on Windoze, forward-slash on *N?X).