List of global variables in PHP:
$GLOBALS $_server$_request$_post$_get$_files$_env$_cookie$_session
1. $GLOBALS can convert PHP variable A into a global variable in $globals[' a ']!
For example:
<?php $x = 75; $y = 25; function addition () {$GLOBALS [' z '] = $GLOBALS [' x '] + $GLOBALS [' Y '];} addition (); echo $z;?>
2, $_server This super global variable holds information about the header, path, and location of the script.
For example:
<?php echo $_server[' php_self '];echo "<br>", echo $_server[' server_name '];echo "<br>"; Echo $_server[' Http_host '];echo ' <br> '; Echo $_server[' http_referer '];echo ' <br> '; Echo $_server[' http_user_agent ']; echo "<br>"; Echo $_server[' script_name ');? >
3. PHP $_request is used to collect data submitted by HTML forms. The usage is identical with $_get and $_post;
Detailed description of global variables in PHP