I want an array where each field in the array contains a color code
array(0 => \'#4CFF00\', 1 => \'#FFE97F\')
And I want this to go t
I stumbled upon this question - and surprisingly I could not find an actual solution for this on the web (I did not try hard). Performance is besides the point here - this is not what you would want to do - this is just an exercise - but if you actually wanted to iterate over all hex colors - here is how you could do it:
for($i = 0; $i <= 16777215; $i++) {
echo sprintf('%06s', dechex($i));
}
Of course this question is old and answered, but thought I would share this anyway.