How to convert php url to an array: First create a PHP sample file; then define a url parameter string; finally use the "parse_str($str, $arr);" method to convert the url to an array. .
Recommended: "PHP Video Tutorial"
parse_str()—Convert the url parameter string into an array
Convert url parameter string into array
$str = 'a=1&b=2&c=3'; parse_str($str, $arr); var_dump($arr); //输出 array (size=3) 'a' => '1' (length=1) 'b' => '2' (length=1) 'c' => '3' (length=1)
The above is the detailed content of How to convert php url to array. For more information, please follow other related articles on the PHP Chinese website!