<?php $int = 12; $min = 1; $max = 100; if(filter_var($int,'FILTER_VALIDATE_INT', array("options"=>array("min_range"=>$min,"max_range"=>$max))) === false){ echo ("The number is valid"); }else{ echo ("The number is not valid"); } ?>
愿能多结交志同道合的基友!哈哈哈。。。。。
First $arr = range(1,100);
foreach($arr as $k $v)
if ($ int === $ v)
{
Echo 'Not';
##}
Just remove the quotes from 'FILTER_VALIDATE_INT'
First $arr = range(1,100);
foreach($arr as $k $v)
if ($ int === $ v)
{
## Echo ' #} Else {Echo 'Not';
##}
# Does it work?Just remove the quotes from 'FILTER_VALIDATE_INT'