Return to Snippet

Revision: 57271
at May 23, 2012 21:09 by pruntrut


Initial Code
function random_color(){
    mt_srand((double)microtime()*1000000);
    $c = '';
    while(strlen($c)<6){
        $c .= sprintf("%02X", mt_rand(0, 255));
    }
    return $c;
}

Initial URL

                                

Initial Description
Random color hex

Initial Title
Random color hex

Initial Tags
php, color

Initial Language
PHP