intval() function: pass a second parameter that specifies the base for the conversion
<?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