decoct() and octdec()

<?php
$orig_dec = 789;
$dec2oct = decoct($orig_dec);
$oct2dec = octdec($dec2oct);
echo "original decimal number: $orig_dec <br>"; // 789
echo "octal number: $dec2oct <br>"; //1425
echo "back to decimal: $oct2dec <br>"; // 789
?>

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 *