Home >php教程 >php手册 >php生成随机颜色代码实例

php生成随机颜色代码实例

WBOY
WBOYOriginal
2016-06-13 10:04:311319browse

本文章给各位同学介绍php生成随机颜色代码实例,有需要了解学习的朋友可参考。

 代码如下 复制代码
function randrgb() 

  $str='0123456789ABCDEF'; 
    $estr='#'; 
    $len=strlen($str); 
    for($i=1;$i     { 
        $num=rand(0,$len-1);   
        $estr=$estr.$str[$num];  
    } 
    return $estr; 
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn