How to generate random colors in php, generate
in php
The example in this article describes how to generate random colors in PHP. Share it with everyone for your reference. The specific implementation method is as follows:
Copy code The code is as follows:
function randrgb()
{
$str='0123456789ABCDEF';
$estr='#';
$len=strlen($str);
for($i=1;$i<=6;$i++)
{
$num=rand(0,$len-1);
$estr=$estr.$str[$num];
}
Return $estr;
}
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/910588.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/910588.htmlTechArticleHow to generate random colors in php, php generation This article describes how to generate random colors in php. Share it with everyone for your reference. The specific implementation method is as follows: Copy the code The code is as follows...