Home >Backend Development >PHP Tutorial >PHP determines whether the data from FORM is an integer
The is_int function has no way to determine whether the data coming from FORM is an integer, because the data coming from FORM is a string. Use is_numeric to determine whether it is a numeric type, and with a little effort you can determine whether it is an integer
if(!is_numeric($jp_total)||strpos($jp_total,".")!==false){ echo "不是整数"; }else{ echo "是整数"; }
The above introduces how PHP determines whether the data from FORM is an integer, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.