Strings & Patterns Learning Mode

The parse_str() function is used to parse a query string just as if it were passed in the URL of a HTTP request. If the second argument is included then the parsed values are written to this variable.

What is the output of the following script?

<?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;
?>

Enter the exact script output