Answers for "how to check if var can be int php"

PHP
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

Code answers related to "how to check if var can be int php"

Browse Popular Code Answers by Language