Random color function PHP

Random color function PHP

[cc lang=”php” escaped=”true” width=”90%” theme=”default” line_numbers=”on”]
function rand_color() {
return ‘#’ . str_pad(dechex(mt_rand(0, 0xFFFFFF)), 6, ‘0’, STR_PAD_LEFT);
}