代码如下
<?php
$var=300;
$int_options = array(
"options"=>array
(
"min_range"=>0,
"max_range"=>256
)
);
if(!filter_var($var, FILTER_VALIDATE_INT, $int_options))
{
echo("Integer is not valid");
}
else
{
echo("Integer is valid");
}
?>
------解决方案--------------------
$int_options = array(
"options"=>array
(
"min_range"=>0,
"max_range"=>256
)
);
php数组的定义
=> 是数组成员访问符号 键名为options,值为array("min_range"=>0,"max_range"=>256) ...