Answers for "how to check a variable if is number in php"

PHP
2

php is variable a number

if(is_numeric($what_am_i)){
	//true
}
Posted by: Guest on September-24-2020
0

php check if variable is int

// Check if variable is int
$id = "1";

if(!intval($id)){
  throw new Exception("Not Int", 404);
}
else{
	// this variable is int
}
Posted by: Guest on August-02-2021
0

php is int

is_int(mixed $value): bool
Posted by: Guest on September-08-2021

Code answers related to "how to check a variable if is number in php"

Browse Popular Code Answers by Language