PHP의 filter_has_var () 함수
정의 및 사용
지정된 입력 변수 타입이 존재하는지 여부 filter_has_var () 함수를 검사한다.
이 TRUE를 반환 성공하면, 실패 할 경우 FALSE를 반환합니다.
문법
filter_has_var(type, variable)
参数 | 描述 |
---|---|
type | 必需。规定要检查的类型。 可能的输入类型:
|
variable | 必需。规定要检查的变量。 |
예
이 예에서, 입력 변수 "이름"은 PHP 페이지로 전송된다 :
<?php
if(!filter_has_var(INPUT_GET, "name"))
{
echo("Input type does not exist");
}
else
{
echo("Input type exists");
}
?>
if(!filter_has_var(INPUT_GET, "name"))
{
echo("Input type does not exist");
}
else
{
echo("Input type exists");
}
?>
다음과 같이 출력 코드는 다음과 같습니다
Input type exists
전체 PHP 필터 참조