php to int
snippet in php

php string to int

user7223

intval($string);

convert string to int php

user815

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

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

php float to int

user1684

$int = intval($float);

cast string to int php

user9184

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

convert to int php

user6110

$myintvariable = intval($myvariable);

php to int

user2024

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