String_Manipulation / Parsing_a_Query_String


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:

<?php

$str 
"first=value&arr[]=foo bar&arr[]=baz";
parse_str($str);
echo 
$first;  // value
echo $arr[0]; // foo bar
echo $arr[1]; // baz

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

?>

Description

  Parsing a Query String into variables