- parse_str: documentation ( source)
- array_search: documentation ( source)
<?php
$str = "days=Mon&days=Wed"
. "&fruit[1]=Apple&fruit[]=Banana&age=13";
parse_str($str, $output);
// gettype will return 'array' or 'string'
echo gettype($output['days']);
echo ' - ';
// array_search will return the key
// where the first argument is located
echo array_search('Banana', $output['fruit']);
echo ' - ';
echo array_key_exists('age', $output) ? $output['age'] : 0;
?>