php url解析

2021-10-08
// 将url传递的查询字符串(query string)解析到$result数组中;查询字段为键,查询数据为值
parse_str($string,  $result);

/*
$str = "first=value&arr[]=foo+bar&arr[]=baz";

parse_str($str, $output);
echo $output['first'];  // value
echo $output['arr'][0]; // foo bar
echo $output['arr'][1]; // baz
*/

 

{/if}