Topic: https://www.bin-co.com/php/articles/current_file_path.php
hide preview

What's next? verify your email address for reply notifications!

unverified 2y, 166d ago

I think the PHP documention for $_SERVER['PHP_SELF'] could be written better. Why did the writers include this part (which this page mindlessly regurgitates verbatim): "The FILE constant contains the full path and filename of the current (i.e. included) file." I think the reason is the original author is trying to make a comparison, but not being explicit enough. I think he or she is saying $_SERVER['PHP_SELF'] vs. FILE are complimentary: If $_SERVER['PHP_SELF'] is referenced from an included file, it returns the path to the includING file. But if FILE is referenced from an included file, it returns the path to the includED file.

hide preview

What's next? verify your email address for reply notifications!