intval() function: pass a second parameter that specifies the base to use for the conversion.
The default value is 10, but it's possible to use base 2 (binary), 8 (octal), 16 (hexadecimal), or any other value such as 32 or 36
<?php
echo intval('123', 10) . "\n";
echo intval('101010', 2) . "\n";
echo intval('123', 8) . "\n";
echo intval('123', 16) . "\n";
echo intval('H123', 32) . "\n";
echo intval('H123', 36) . "\n";
?>
Related examples in the same category