您好,欢迎访问一九零五行业门户网

php生成随机颜色

一段php生成随机颜色的代码,如:ff00ff
function random_color(){ mt_srand((double)microtime()*1000000); $c = ''; while(strlen($c) $c .= sprintf(%02x, mt_rand(0, 255)); } return $c;} //使用范例:random_color() => returns something like: '7c42ba', '5f3964'
复制代码
php
其它类似信息

推荐信息