note 91534 modified in function.rand by danbrown

From: Date: Tue, 16 Jun 2009 14:38:33 +0000
Subject: note 91534 modified in function.rand by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-156921@lists.php.net to get a copy of this message
I thought this function (random color) might be of use to someone [to create and return a random hex for HTML colors]: <?php function get_random_color() { for ($i = 0; $i<6; $i++) { $c .= dechex(rand(0,15)); } return "#$c"; } ?> --was-- I thought this function (random color) might be of use to someone [to create and return a random hex for HTML colors]: function get_random_color() { for ($i = 0; $i<6; $i++) { $c .= dechex(rand(0,15)); } return "#$c"; } http://php.net/manual/en/function.rand.php

« previous php.notes (#156921) next »