I have nothing to do today to tell you that I learned php many years ago to learn how to use get global variables. For more information, see.
I have nothing to do today to tell you that I learned php many years ago to learn how to use get global variables. For more information, see.
1. $ _ GET is used to obtain data in the form of get in the table method.
2. $ _ GET url. php? I = 12 data,
The above is the data we often use get to obtain values,
Instance 1: Get form data
The instance code is as follows:
-
Get. php
If I fill in a http://www.phpfensi.com
The instance code is as follows:
- You are .
The output result is
The instance code is as follows:
- You are http://www.phpfensi.com
What is the url style when we click to submit?
The instance code is as follows:
- Get. php? Username = www.phpfensi.com
This form is the second method we are talking about to obtain data. next we will look at using a for reference.
/A. php? Value = my
A. php
The instance code is as follows:
- The value of value is .
The output result is
The instance code is as follows:
- The value of value is my.
This seems to be no different from form's method = get. haha, the article is here.
There is another way to get, that is, the form of direct $ _ GET, and view the instance.
The instance code is as follows:
- Apple
- Orange
- Mango
Checkbox. php file code
The instance code is as follows:
- ";
- Foreach ($ _ GET ["fruit"] as $ value)
- {Echo $ value ," ";
- }?>
The output result is
If you choose Orange and Mango
Note that $ _ GET is not suitable for obtaining a large amount of data. the length value cannot exceed 100 characters.