parse_str

void parse_str(string query_string, [variable $array]) 

Parses a query string into variables.

Returns:

Nothing

Description:

parse_str() parses a query string (such as "?id=10&name=Ziggy%20Stardust") into variables that are then set in the local scope. If the optional $array argument is set, the variables are stored in $array as an array instead of being set in the local scope.

Note:

PHP automatically handles GET and POST data. In most cases, there is no need to decode query strings with this function.

If the magic_quotes_gpc configuration directive is enabled, the variables are processed with addslashes() before they’re set.

Caution:

If $array is not set, variables parsed out of the query_string overwrite variables that already exist ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.