hex - Generate string from 00:00:00 to FF:FF.FF in php -


i need generate , echo values 00:00:00 ff:ff.ff counting 1 1000000. know numbers how hexadecimal numbers? example need @ echo:

 00:00:00  00:00:01  00:00:02  .  .  .  ff:ff:00  ff:ff:01  ff:ff:02  .  .  .  ff:ff:ff 

how in php?

php accepts integer literals in hexdecimal format, you'd iterating 0 0xffffff. each iteration, convert integer decimal format, left-pad zeroes , split every character , implode : format want:

for ($i = 0; $i < 0xffffff; ++$i) {     echo implode(':',      str_split(str_pad(strtoupper(dechex($i)),        6,        '0',        str_pad_left),      2)) .      '<br>'; } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -