cadena php a int
intval($string);
Concerned Chipmunk
intval($string);
phpCopy<?php
$variable = "53";
$integer = intval($variable);
echo "The variable $variable has converted to a number and its value is $integer.";
echo "\n";
$variable = "25.3";
$float = floatval($variable);
echo "The variable $variable has converted to a number and its value is $float.";
?>
<?php
$string = "56";
$int = intval( $string );
echo $int;
?>
// intval() function to convert
// string into integer
echo intval($num), "\n";
s = "123";
echo intval(s); // 123
s = "hello";
echo intval(s); //0
intval ( mixed $var [, int $base = 10 ] ) : int