Home > Article > Backend Development > What is the role of php super global variables
The function of php super global variables is to make many predefined variables available in the entire scope of a script, and they can be accessed in functions or methods without executing "global $variable;".
php super global variables
Super global variables were introduced in PHP 4.1.0. Built-in variables are always available in all scopes.
PHP Global Variables - Superglobal Variables
Many of the predefined variables in PHP are "superglobal", which means they are available throughout the entire scope of a script. They can be accessed within a function or method without executing global $variable;.
These super global variables are:
$GLOBALS $_SERVER $_REQUEST $_POST $_GET $_FILES $_ENV $_COOKIE $_SESSION
Please visit the "Super Global Variables" chapter: https://www.php.cn/php/php-superglobals.html
The above is the detailed content of What is the role of php super global variables. For more information, please follow other related articles on the PHP Chinese website!