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

php code to get random colors

WBOY
Release: 2016-07-25 08:45:12
Original
1109 people have browsed it
  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


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template