str into int in php code example
Example 1: php string to int
intval($string);
Example 2: echo intval
<?php
echo intval(42);
echo intval(4.2);
echo intval('42');
echo intval('+42');
echo intval('-42');
echo intval(042);
echo intval('042');
echo intval(1e10);
echo intval('1e10');
echo intval(0x1A);
echo intval(42000000);
echo intval(420000000000000000000);
echo intval('420000000000000000000');
echo intval(42, 8);
echo intval('42', 8);
echo intval(array());
echo intval(array('foo', 'bar'));
echo intval(false);
echo intval(true);
?>