What is the difference between $_SERVER["SCRIPT_NAME"] and realpath('.') in PHP?
$_SERVER["SCRIPT_NAME"] returns the path of the current script relative to the document root, while realpath('.') returns the absolute path of the current working directory. If you need the absolute path of the current script, you should use realpath($_SERVER["SCRIPT_NAME"]) to get the correct path.
$absolutePath = realpath($_SERVER["SCRIPT_NAME"]);
echo $absolutePath;
Related questions
-
Is there a way to automate the process of updating multiple records in phpmyadmin using PHP scripts?phpmyadmin PHP scripts automate
-
PHP encryption decryption
-
mysqli functions PHP classes Verbindung