php parse_str 将url参数字符串转成数组

将url参数字符串转成数组

$str = ‘a=1&b=2&c=3’;

parse_str($str, $arr);

var_dump($arr);

//输出

array (size=3)

‘a’ => string ‘1’ (length=1)

‘b’ => string ‘2’ (length=1)

‘c’ => string ‘3’ (length=1)