Use of GET variables in PHP. Read the use of GET variables in PHP and save HTTP_GET_VARS with GET variables after PHP4.1.0, GET variables mainly come from the following methods for the server to obtain information as the request METHOD, such as URL, using form method as the get method. In this way, all request variables are passed to the server through the URL. the server saves HTTP_GET_VARS using the GET variable after <LINKh from PHP4.1.0. The GET variable mainly comes from the following methods:
For example, the URL that requests the server to obtain information, use the form method as the get method. In this way, all request variables will pass
The URL is passed to the server, and the server calls the relevant interpreter according to the configuration to process these GET variables.
This article discusses how to pass values in url get mode.
We all know that the URL value is URL? Variable name = variable value
For example
Http://www.bbs.bbc.com? Page = 1
This method is common to us.
If there are more variables, use the '&' symbol to connect to the variable.
The above method is to convert the variables directly to the corresponding array in the browser, so we don't need to know much about it. The topics I want to discuss are as follows:
In this example, we use the ',' symbol as the variable Separator. here we can use two methods to implement it,
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 the explanation Syntax by yourself
List ($ key, $ value) = $ _ GET; // splits the GET variable out.
$ Tmp = explode (",", $ value); // separates 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.
The pass-through method of this type of GET method is actually the same as method 2. what is needed is 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 );
You should have obtained the data.
The above method is the method that I think of when I browse other sites. I wonder if it is correct. Users who install PHP by default prefer to use the default GET value passing method.
If the company has specific requirements, consider using the following methods ~
Learning is limited. please correct me if you have any questions.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.