Jump to content

Generating Hexadecimal values


alexislalas

Recommended Posts

kickstart beat me to it, but I created a function (plus his has a typo because of the [ code ] tag), so I'll post mine anyway:

<?php

function getHexRange($start, $end)
{
    $startDec = hexdec($start);
    $endDec   = hexdec($end);
    $hexArray = array();

    for($dec=$startDec; $dec<=$endDec; $dec++)
    {
        $hexArray[] = dechex($dec);
    }
    return $hexArray;
}

$range = getHexRange('9CF90000', '9CF910CB');

print_r($range);

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.