Copy CodeThe code is as follows:
/* pre-defined array:
* AUTO global variable---Hyper global array
*
* 1. Contains data from the Web server, client, run environment and user input
* 2. These arrays are more specific
* 3. The global scope automatically takes effect, you can use these arrays directly
* 4. Users cannot customize these arrays, but these arrays operate in the same way as array operations of their own definition
* 5. These arrays can be used directly in the function
*
* $_get//The variable submitted to the script via URL request
* $_post//variables submitted to the script via the HTTP POST method
* $_request//variables submitted to the script via get, post and cookie mechanism
* $_files//variables submitted to the script via HTTP POST method file upload
* $_cookie
* $_session
* $_env//Execution Environment commit to script variable
* $_server//variables are set by the Web server or are directly associated with the execution environment of the current script
* $GLOBALS//As long as the current script is valid variables are here, the array's key name is the name of the global script
*
*
*/
A hyper-global array can be called directly inside a function
$arr =array (10,20);//General array
$_get=array (50,90);///Hyper Global Array
Function Demo () {
Global $arr;//The call is to first include
Print_r ($arr);
Print_r ($_get);//directly calling a hyper-global array does not include
}
?>
Use the worth variable directly, which is useful when register_global=on in the php.ini configuration file.
echo $username. "
";
echo $email. "
";
echo $page. "
";
The most stable method of taking value
echo $_get["username"]. "
";
echo $_get["email"]. "
";
echo $_get["page"]. "
";
?>
This is a $_get test
Print_r ($_get);//cannot receive
Print_r ($_post);//To receive
?>
Use of $_env
Echo
Echo
';
Show Current environment
You can also traverse a single
?>
Calling global variables inside a function using a $globals hyper-global Array
$a = 100;
$b = 200;
$c = 300;
Function Demo ()
{
Calling global variables directly
echo $GLOBALS ["a"]. "
";
echo $GLOABLS ["B"]. "
";
echo $GLOABLS ["C"]. "
";
}
?>
http://www.bkjia.com/PHPjc/323578.html www.bkjia.com true http://www.bkjia.com/PHPjc/323578.html techarticle Copy the code as follows:? PHP/* Predefined array: * Auto global variable---Hyper global array * * 1. Contains data from Web server, client, run environment and user input * ...