Home >Backend Development >PHP Tutorial >The difference between __FILE__ and $_SERVER['SCRIPT_FILENAME']
Execute a.php to get:
and execute b.php, the result is: E:/var/www/b.php ($_SERVER['SCRIPT_FILENAME']) E:wampwwwTexta.php (__FILE__)From this, we can draw the difference between the two: $_SERVER['SCRIPT_FILENAME'] The absolute path and file name of the currently executing program __FILE__ The absolute path and file name of the original file (included file) Dear, do you understand? Regarding the difference between __FILE__ and $_SERVER['SCRIPT_FILENAME'], please understand the meaning contained in the above example. |