文字

http_build_str

(PECL pecl_http >= 0.23.0)

http_build_str产生一个查询字符串

说明

string http_build_str ( array $query [, string $prefix [, string $arg_separator = ini_get("arg_separator.output") ]] )

根据 array 里的查询变量建立一个 query string。在效果上,这个函数和 parse_str() 正好相反。

参数

query

查询字符串参数的关联数组。

prefix

顶层前缀。

arg_separator

使用的参数分隔符号(默认使用 INI 设置中的 arg_separator.output,如果都没设置则使用 "&")。

返回值

成功时返回产生的查询字符串, 或者在失败时返回 FALSE

参见

  • standard http_build_query() - 生成 URL-encode 之后的请求字符串
  • http_build_url() - 产生一个 URL

用户评论:

[#1] g dot kuizinas at anuary dot com [2013-02-12 01:51:46]

For those who are using PECL pecl_http 2, you need to refer to HttpQueryString, which is now implemented under http namespace. Therefore,

<?php new \http\QueryString(); ?>

上一篇: 下一篇: