PHP Velho Oeste 2024

HttpQueryString::get

(PECL pecl_http >= 0.22.0)

HttpQueryString::getクエリ文字列 (あるいはその一部) を取得する

説明

public mixed HttpQueryString::get ([ string $key [, mixed $type = 0 [, mixed $defval = NULL [, bool $delete = false ]]]] )

クエリ文字列 (あるいはその一部) を取得します。

パラメータ

key

取得するクエリ文字列パラメータのキー。

type

変数の型。返す値をこの型にあわせます。

HttpQueryString::TYPE_* 定数のいずれか、 あるいは型を省略したものを指定します。例えば "b" は bool、"i" は int、"f" は float、 "s" は string、"a" は array そして "o" は stdClass オブジェクトです。

defval

key が存在しない場合のデフォルトの値。

delete

クエリ文字列から key を削除するかどうか。

返り値

クエリ文字列パラメータの値を返します。key が指定されない場合は、 クエリ文字列全体を返します。key が存在しない場合は defval を返します。

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top