Pre-defined arrays:
Automatic Global variables---hyper-global arrays
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 data operate in the same way as our custom array operations
5. These arrays can be used directly in functions
$_get//The variables submitted to the script via URL request, form default submission method and link submission method
$_post//variables submitted to the script via the HTTP POST method
$_request//Through GET, post and cookie mechanisms to commit variables to the script, so the array is not trustworthy, try not to use
<?PHPEcho $_get["username"]. " <br> "; Echo $_get["Email"]. " <br> "; Echo $_get["Page"]. " <br> "; $_get["Eeee"]= ""; Print_r($_get); Print_r($_post); Print_r($_request);? ><form action= "demo.php" method= "POST" >username: <input type= "text" name= "uname" ><br>Password: <input type= "password" name= "pass" ><br> <input type= "Submit" value= "Login" > <BR></FORM&G T;<a href= "Demo.php?username=zhangsan&[email protected]&page=45" >this is a$_getTest</a>
$_files//upload via HTTP POST file to script, file processing chapter, File upload
$_cookie//
$_session//
$_ENV//Execution Environment commit to script variables
<? php echo ' <pre> ' ; print_r ($_env echo ' </pre> ' ; echo $_env ["OS"]. " <br> "; foreach ($_env as $key => $value echo $key ." =". $value . " <br> "; }
$_server//variables are set by the Web server or are directly associated with the execution environment of the current script
<? php echo ' <pre> ' ; print_r ($_server ); echo ' </pre> ' ; echo $_server ["Document_root"]. " <br> "; foreach ($_server as $key => $value ) { echo $key ." =". $value . " <br> "; }
$GLOBALS//As long as the current script is valid variables are here, the array key name is the name of the global variable
Pre-defined Hyper-global arrays in PHP base-php