Good Day
Does anyone have a class that outputs the iteration of hex values according to a range?
E.g. 520-52f
I need to get a list of the values within that range.
Like
520
521
522
... for the 16 values
Resolved: PHP and Hexadecimal
Moderator: General Moderators
- thomas777neo
- Forum Contributor
- Posts: 214
- Joined: Mon Mar 10, 2003 6:12 am
- Location: Johannesburg,South Africa
Resolved: PHP and Hexadecimal
Last edited by thomas777neo on Mon Jul 16, 2007 7:15 am, edited 1 time in total.
- thomas777neo
- Forum Contributor
- Posts: 214
- Joined: Mon Mar 10, 2003 6:12 am
- Location: Johannesburg,South Africa
Thanks feyd, never had to use the range function yet (quite an obvious one)
Here is the quick and dirty version so far:
Works just fine for now. Thanks again.
Here is the quick and dirty version so far:
Code: Select all
$start_range = hexdec("0520");
$end_range = hexdec("052f");
foreach (range($start_range,$end_range) as $number)
{
$dechex = dechex($number);
} // foreach (range($start_range,$end_range) as $number)