dechex: convert decimal to hexadecimal : Hexadecimal Number « Data Type « PHP






dechex: convert decimal to hexadecimal


<?php
$orig_dec = 255;
$dec2hex = dechex($orig_dec);
$hex2dec = hexdec($dec2hex);
echo "original decimal number: $orig_dec <br>";
echo "new hexadecimal number: $dec2hex <br>";
echo "back to decimal: $hex2dec <br>";
?>
           
       








Related examples in the same category

1.hexdec: convert hexadecimal to decimal