Parses a string into variables to be stored in an array.
Parameters
$input_string
stringrequired- The string to be parsed.
$result
arrayrequired- Variables will be stored in this array.
Source
function wp_parse_str( $input_string, &$result ) {
parse_str( (string) $input_string, $result );
/**
* Filters the array of variables derived from a parsed string.
*
* @since 2.2.1
*
* @param array $result The array populated with variables.
*/
$result = apply_filters( 'wp_parse_str', $result );
}
Hooks
- apply_filters( ‘wp_parse_str’,
array $result ) Filters the array of variables derived from a parsed string.
Changelog
Version | Description |
---|---|
2.2.1 | Introduced. |
Let’s say, you have an URL with query parameters. And you need query parameter values in an Array.