Use the parse_str function to parse the query string into a variable
Definition and usage
The parse_str() function parses the query string into variables.
Note: If the array parameter is not set, the variable set by this function will overwrite the existing variable with the same name.
Note: The magic_quotes_gpc setting in the php.ini file affects the output of this function. If it is enabled, the variable will be converted by addslashes() before parsing by parse_str().
grammar
parse_str(string,array)
parameter | description |
---|---|
string | Required. Specifies the string to be parsed. |
array | Optional. Specifies the name of the array in which to store the variable. This parameter indicates that the variable is stored in the array. |
parse_str("name=qipa250&url=www.qipa250.com",$qipaArray);
print_r($qipaArray);
Array
(
[name] => qipa250
[url] => www.qipa250.com
)