将字符串解析为要存储在数组中的变量。
原型
wp_parse_str( string $string, array $array )
描述
如果启用了magic_quotes_gpc,则使用parse_str()和stripslashes。
参数
$string
(string)
(Required)
要解析的字符串。
$array
(array)
(Required)
变量将存储在此数组中。
源文件
路径:wp-includes/formatting.php
<?php
...
function wp_parse_str( $string, &$array ) {
parse_str( $string, $array );
if ( get_magic_quotes_gpc() )
$array = stripslashes_deep( $array );
/**
* Filters the array of variables derived from a parsed string.
*
* @since 2.3.0
*
* @param array $array The array populated with variables.
*/
$array = apply_filters( 'wp_parse_str', $array );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/wp_parse_str/