Anvar Logo
01 / 01
Anvar Logo +91 808 999 0405

PHP superglobal variables

A superglobal is a predefined variable that is always accessible, regardless of scope. You can access the PHP superglobals through any function, class, or file.
PHP’s superglobal variables are $_SERVER, $GLOBALS, $_REQUEST, $_POST, $_GET, $_FILES, $_ENV, $_COOKIE, $_SESSION.


$_SERVER is an array that includes information such as headers, paths, and script locations. The entries in this array are created by the web server.
$_SERVER[‘SCRIPT_NAME’] returns the path of the current script:

//Outputs "/test.php"


by anvar
Published : Nov , 28

Post a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.