Home >Backend Development >PHP Tutorial > 简单的php判断

简单的php判断

WBOY
WBOYOriginal
2016-06-13 13:01:00809browse

求一个简单的php判断
判断一个变量 只能为大于1的整数 比如1,2,3,4,5,6,7,8,9,32,23,24,64
------解决方案--------------------
$a = 2;//你需要判断的值
echo is_int($a)&&$a>1 ? 1 :0;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn