php float to int
snippet in php

php string to int

user2581

intval($string);

convert string to int php

user7900

s = "123";
echo intval(s); // 123

s = "hello";
echo intval(s);	//0

php float to int

user3856

$int = intval($float);

cast string to int php

user5483

$num = "3.14"; 
$int = (int)$num;//string to int
$float = (float)$num;//string to float

convert to int php

user8325

$myintvariable = intval($myvariable);

php to int

user5762

$num = "3.14";
$int = (int)$num;