Today I have nothing to do and I will tell you how to use get global variables when I learned PHP more than a year ago. Friends who need to get started can refer to it.
1. $_GET is to obtain the data in the form of get table method
2. $_GET gets the data of url.php?i=12,
The above is the data we commonly use get to obtain values,
Example 1, obtaining form data
The code is as follows | Copy code | ||||
|
代码如下 | 复制代码 |
You are . |
If I fill in www.hzhuti.com
The code is as follows | Copy code | ||||
|
代码如下 | 复制代码 |
get.php?username=www.hzhuti.com |
The code is as follows | Copy code |
You are www.hzhuti.com
|
The code is as follows | Copy code | ||||
get.php?username=www.hzhuti.com
|
This is the form, which is the second method of obtaining data. Let’s look at using a with reference
代码如下 | 复制代码 |
value的值是 my |
The code is as follows | Copy code |
The value of value is . |
The code is as follows | Copy code |
The value of value is my |
This looks no different from method=get of form, haha, that’s it for the article.
There is another way to get, which is to directly $_GET. What form will it take? See the example.
The code is as follows
|
Copy code
|
||||
"; foreach ($_GET["fruit"] as $value) Reprints of original tutorials from the original site must indicate the source: http://www.bKjia.c0m/phper/php.html |