Posted By

pruntrut on 05/23/12


Tagged

php color


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

canberkol


Random color hex


 / Published in: PHP
 

Random color hex

  1. function random_color(){
  2. mt_srand((double)microtime()*1000000);
  3. $c = '';
  4. while(strlen($c)<6){
  5. $c .= sprintf("%02X", mt_rand(0, 255));
  6. }
  7. return $c;
  8. }

Report this snippet  

You need to login to post a comment.