Home > Article > Backend Development > Explain the predefined super global array variables of PHP arrays
php Arrays play an important role in php. This article will explain its related contents in detail.
1)GLOBALS
2) _SERVER
Server variables, different web servers may have different contents
3) G ET gets HTTPGET Parameters passed by the HTTP POST method, such as parameters passed by the url or form GET method
4) _POST
Get parameters passed by the HTTP POST method, such as parameters passed by the form POST method
5) F ILESHTTP file upload variable
6) _COOKIE
7) S ESSION
8) _REQUEST
includes G ET, _POST and C OOKIE All content in .
9) _ENV
Environment variables are related to the environment in which PHP is running.
If there is no data, it may be related to the phpini configuration item variables_order configuration item
already A defined (existing) variable (the type of data stored is an array).
Super global: super global variable, scope (valid area)!
There are two main ways to pass data (submit data) to the server
1.get method
For example:
Parameter name=parameter value¶meter Name = parameter value...
On the server side (the requested php file), you can obtain the _GET index value as the parameter name through GET, and the data corresponding to the index value is the parameter value
2.Post method
For example, it is sent via form post!
Can be obtained through $_POST!
<?php var_dump($_GET); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>预定义超全局数据变量</title> </head> <body> <form method="get"> 姓名:<input type="text" name='username' /><br /> 性别:<input type="text" name='sex' /><br /> <input type="text" name='dwqdwqdqw' /> <input type="submit" value='提交' /> </form> </body> </html>
This article explains the predefined super-global array variables of PHP arrays. For more related content, please pay attention to the PHP Chinese website.
Related recommendations:
Explain how to use pdo placeholder in php
##List PHP null value detection functions and methods
PHP connects to the database and implements the most basic add, delete, modify and query operations through process-oriented methods
The above is the detailed content of Explain the predefined super global array variables of PHP arrays. For more information, please follow other related articles on the PHP Chinese website!