Snippet: parse_query

Snippet Demo Library :: parse_query

This snippet demonstrates the use of PHP's parse_url function and parse_str directive to turn URL parameters into data structures usable within the snippet.

URL: http://mindfire.net/index.php?key1&key2=parm2&key3&key4=parm4
parsed URL:
Array
(
    [scheme] => http
    [host] => mindfire.net
    [path] => /index.php
    [query] => key1&key2=parm2&key3&key4=parm4
)
1
Query parameters: key1&key2=parm2&key3&key4=parm4
parsed query parms:
Array
(
    [key1] => 
    [key2] => parm2
    [key3] => 
    [key4] => parm4
)
1