control type int variable php code example
Example 1: php check if input is int
$a = 5; //returns true
$a = "5"; //returns false
$a = 5.3; //returns false
is_int($a);
Example 2: php to int
$num = "3.14";
$int = (int)$num;
$a = 5; //returns true
$a = "5"; //returns false
$a = 5.3; //returns false
is_int($a);
$num = "3.14";
$int = (int)$num;