PHP Velho Oeste 2024

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") ]] )

クエリ変数の配列から、クエリ文字列を組み立てます。 要するに、この関数は parse_str() の逆の動作をします。

パラメータ

query

クエリ文字列パラメータの連想配列。

prefix

トップレベルのプレフィックス。

arg_separator

引数の区切りとして使用する文字 (デフォルトでは、INI 設定 arg_separator.output が使用されます。 これも設定されていない場合は "&" が使用されます)。

返り値

成功した場合に組み立てたクエリ文字列、 失敗した場合に FALSE を返します。

参考

add a note add a note

User Contributed Notes 1 note

up
-1
g dot kuizinas at anuary dot com
11 years ago
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(); ?>
To Top