檢測是否存在指定型別的變數

filter_has_var

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

filter_has_var — 檢測是否存在指定型別的變數

說明

filter_has_var(int $type, string $variable_name): bool

參數

type

INPUT_GET、 INPUT_POST、 INPUT_COOKIE、 INPUT_SERVER、 INPUT_ENV 里的其中一個。

variable_name

要檢查的變數名。

返回值

成功時返回 true, 或者在失敗時返回 false。

Leave a Reply

Your email address will not be published. Required fields are marked *