hex counter
Moderator: General Moderators
hex counter
Is there any way to create a counter in hex? an example would be count from 0 - F.
Code: Select all
for ($x=0;$x<10000;$x++) {
echo dechex($x);
}- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
onion is right.... PHP reads it as decimal but to use proper hex notation (more understandable to the developer) do this:
Your example:
Your example:
Code: Select all
for ($x=0x00; $x<=0x0F; $x++)
{
echo dechex($x).'<br />';
}