Home >Backend Development >PHP Tutorial >php code to get random colors

php code to get random colors

WBOY
WBOYOriginal
2016-07-25 08:45:121133browse
  1. function randColor(){
  2. $letters = "1234567890ABCDEF";
  3. for($i=1;$i<6;$i++){
  4. $pos = rand(0,16);
  5. $str .= $string{$pos};
  6. }
  7. return "#".$str;
  8. }
  9. echo 'Random Color Text';
  10. ?>
复制代码

php


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
Previous article:PHP compressed imagesNext article:PHP compressed images