Home >Backend Development >PHP Tutorial >Definition and usage of php parse_str() function, phpparse_str_PHP tutorial

Definition and usage of php parse_str() function, phpparse_str_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 08:50:381294browse

Definition and usage of php parse_str() function, phpparse_str

php parse_str() function parses query string into variables, 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.

Definition and usage

The parse_str() function parses the query string into variables.

Note: If the array parameter is not set, the variables set by this function will overwrite the existing variables 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() .

Grammar

parse_str(string,array) 

参数 描述
string 必需。规定要解析的字符串。
array 可选。规定存储变量的数组的名称。该参数指示变量将被存储到数组中。

Technical details

返回值: 无返回值。
PHP 版本: 4
更新日志: 在 PHP 4.0.3 中,新增了 array 参数。

Example

Storing variables in an array:

<&#63;php 
parse_str("name=Bill&age=60",$myArray); 
print_r($myArray); 
&#63;> 

The above definition and usage of the php parse_str() function is all the content shared by the editor. I hope it can give you a reference, and I hope you will support Bangkejia.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1133100.htmlTechArticlephp parse_str() function definition and usage, phpparse_str php parse_str() function parses the query string into a variable , mainly used to transfer values ​​(parameters) between pages. This article introduces coders...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn