(PHP 3 <= 3.0.18, PHP 4 >= 4.0.0)
parse_str -- Parses the string into variables
Description
void parse_str
(string str, array
[arr])
Parses str as if it were the query string
passed via an URL and sets variables in the current scope. If
the second parameter arr is present,
variables are stored in this variable as an array elements instead.
Note:
Support for the optional second parameter was added in PHP 4.0.3.
Example 1. Using parse_str() $str = "first=value&second[]=this+works&second[]=another";
parse_str($str);
echo $first; /* prints "value" */
echo $second[0]; /* prints "this works" */
echo $second[1]; /* prints "another" */ |
|
See also set_magic_quotes_runtime()
and urldecode().