In the development process, GET and POST are everywhere like souls. The $ _ GET variable is an array with the variable name and value sent by the http get method.
The $ _ GET variable is used to collect the values in the form from method = "get. The information sent from a form with the GET method is visible to anyone (displayed in the address bar of the browser), and the amount of information sent is limited (up to 100 characters ).
When $ _ GET is used, all variable names and values are displayed in the URL. Therefore, this method should not be used when sending passwords or other sensitive information. However, because the variables are displayed in the URL, you can add the page to favorites. In some cases, this is useful.
In general, the URL will use the & operator to separate multiple variables. Of course, you can also set it as another symbol. Use the ',' symbol as the variable separator, which can be implemented in two ways:
1. Modify php. ini
——; list of separator(s) used by php to parse input urls into variables.; default is "&". ; note: every character in this directive is considered as separator!arg_separator.input = ";,"————
2. Write your own interpretation syntax
List ($ key, $ value) =$ _ get; // break down the get variable $ tmp = explode (",", $ value); // split the data
The advantage of this usage is that others cannot know who is using the value you passed, and you need to understand the usage of each value.
For http://www.bkjia.com/test.php? Website = bkjia.com is the same as method 2 in the get method. You need to convert the key into value for decomposition. I think this method is better than the previous method, it is more convenient.
$value = key($_GET);$tmp = explode(",", $value);print_r($tmp);
You should have obtained the data.
You can use the following method to traverse the $ _ GET variable with multiple elements:
while( list($key, $value) = each($_GET) ){echo "Key: $key; Value: $value <br />";}
You can also use:
foreach ($_GET as $key => $value) { echo "Key: $key; Value: $value <br />n";}
For $ _ REQUEST variables, PHP's $ _ REQUEST variables include $ _ GET, $ _ POST, and $ _ COOKIE content. The $ _ REQUEST variable of PHP can be used to obtain the results of form data sent through the GET and POST methods.