http://example.com/index.php?test=1 というURLの場合 $_SERVER["SERVER_NAME"]; →example.com $_SERVER["SCRIPT_NAME"]; →/index.php $_SERVER['QUERY_STRING']; →test=1 $_SERVER['SCRIPT_FILENAME']; →/var/www/html/example.com/index.php $_SERVER['REQUEST_URI']; →/index.php?test=1