PHP determines whether the data in FORM or URL parameters is an integer (formurl. PHP determines whether the data in FORM or URL parameters is an integer. formurlPHP determines whether the data in FORM or URL parameters is an integer, the is_int function uses PHP to determine whether the data in the FORM or URL parameter is an integer for FORM or URL parameters. formurl
PHP checks whether the data from FORM or URL parameters is an integer. the is_int function cannot determine whether the data from FORM or URL parameters is an integer because FORM is a string.
Is_numeric can be used to determine whether it is of the numeric type, and then determine whether there is a decimal point to determine whether it is an integer.
If (! Is_numeric ($ page) | strpos ($ page ,".")! = False) {echo "not an integer";} else {echo "is an integer ";}
Sometimes we need to determine whether the id is a number:
Method for Determining numbers in dedecms
$cid = empty($cid)? 1 : intval(preg_replace("/[^-\d]+[^\d]/",'', $cid));
We recommend that you filter key parameters. Such as digital regular expression filtering
The code is as follows:
If (preg_match ("/^ \ d * $/", $ fgid) echo ('number ');
Else echo ('not a digit ');
Or use the function
The code is as follows:
If (is_numeric ($ fgid) echo ('number ');
Else echo ('not a digit ');
Using PHP to determine whether the data in FORM or URL parameters is an integer. the is_int function has passed the FORM or URL parameters...