Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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
}
 
PREVIOUS NEXT
Tagged: #php #check #variable #int
ADD COMMENT
Topic
Name
9+4 =