Answers for "control type int variable php"

PHP
8

php to int

$num = "3.14";
$int = (int)$num;
Posted by: Guest on April-13-2020
1

php check if input is int

$a = 5; //returns true
$a = "5"; //returns false
$a = 5.3; //returns false
is_int($a);
Posted by: Guest on May-25-2020

Browse Popular Code Answers by Language