php parse_str() 函数,phpparse_str函数
php parse_str() 函数,phpparse_str函数
php parse_str() 函数把查询字符串解析到变量中,主要用于页面之间传值(参数)。本文章向码农介绍php parse_str() 函数的使用方法,感兴趣的码农可以参考一下。
定义和用法
parse_str() 函数把查询字符串解析到变量中。
注释:如果未设置 array 参数,则由该函数设置的变量将覆盖已存在的同名变量。
注释:php.ini 文件中的 magic_quotes_gpc 设置影响该函数的输出。如果已启用,那么在 parse_str() 解析之前,变量会被 addslashes() 转换。
语法
parse_str(string,array)
参数 | 描述 |
---|---|
string | 必需。规定要解析的字符串。 |
array | 可选。规定存储变量的数组的名称。该参数指示变量将被存储到数组中。 |
技术细节
返回值: | 无返回值。 |
PHP 版本: | 4+ |
更新日志: | 在 PHP 4.0.3 中,新增了 array 参数。 |
实例
在数组中存储变量:
<?php parse_str("name=Bill&age=60",$myArray); print_r($myArray); ?>
在线运行
原文地址:http://www.manongjc.com/article/858.html
相关阅读:
php echo输出一个或多个字符串
php print() 函数输出打印字符串
php parse_str() 函数将传递的参数字符串解析到变量中
php ord() 函数获取字符串首个字符的 ASCII 值
php number_format() 函数按照千位分组来格式化数字
php nl2br() 函数将字符串中的换行符转成HTML的换行符号
php nl_langinfo() 函数获取具体的本地信息

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
