php parse_str() function, phpparse_str function_PHP tutorial

WBOY
Release: 2016-07-12 08:52:20
Original
1007 people have browsed it

php parse_str() function, phpparse_str function

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.

Definition and usage

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() .

Grammar

parse_str(string,array)
Copy after login

 

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

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

array

parameter was added.

<?php
parse_str("name=Bill&age=60",$myArray);
print_r($myArray);
?>
Copy after login
Example

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 symbols

php nl_langinfo() function obtains specific local information http://www.bkjia.com/PHPjc/1127593.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1127593.html
TechArticlephp 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...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!