php parse_str() function parses the query string into variables, and is mainly used to transfer values (parameters) between pages. This article introduces to coders how to use the php parse_str() function. Interested coders can refer to it.
The parse_str() function parses the query string into variables.
Note: If the array parameter is not set, the variable set by this function will overwrite the existing variable with the same name.
Note: The magic_quotes_gpc setting in the php.ini file affects the output of this function. If enabled, variables are converted by addslashes() before being parsed by parse_str() .
parse_str(string,array)
Parameter | Description | ||||||
---|---|---|---|---|---|---|---|
|
Required. Specifies the string to parse. | ||||||
array | Optional. Specifies the name of the array in which the variable is stored. This parameter indicates that the variable will be stored in an array. |
返回值: | 无返回值。 |
PHP 版本: | 4 |
更新日志: | 在 PHP 4.0.3 中,新增了 array 参数。 |
Technical details
Return value: | No return value. |
PHP version: | 4 |
Update log: | In PHP 4.0.3, the arrayparameter was added. |
<?php parse_str("name=Bill&age=60",$myArray); print_r($myArray); ?>
Storing variables in an array:
Run online
Original address: http://www.manongjc.com/article/858.html
Related reading:
php echo outputs one or more strings
php print() function outputs a print string
The php parse_str() function parses the passed parameter string into a variable
php ord() function gets the ASCII value of the first character of a string
php number_format() function formats numbers according to thousands groups
The php nl2br() function converts the newline characters in the string into HTML newline symbolsTechArticlephp parse_str() function, phpparse_str function php parse_str() function parses the query string into a variable, mainly used Pass values (parameters) between pages. This article introduces php pa to programmers...