intval()

pass a second parameter that specifies the base for the conversion
<?php
echo intval('123', 10) . "\n<br>"//123
echo intval('101010', 2) . "\n<br>"; // 42
echo intval('123', 8) . "\n<br>"// 83
echo intval('123', 16) . "\n<br>"// 291
echo intval('H123', 32) . "\n<br>"; // 558147 
echo intval('H123', 36) . "\n<br>"// 794523 
?>

Post to Twitter Post to Digg Post to Facebook Post to Google Buzz Send Gmail

Leave a Comment

Your email address will not be published. Required fields are marked *