Random Hex Color | CSS-Tricks

PHOTO EMBED

Tue Jun 02 2020 03:52:39 GMT+0000 (UTC)

Saved by @Amna #php

<?php 
    
    $rand = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
    $color = '#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
    
?>
content_copyCOPY

https://css-tricks.com/snippets/php/random-hex-color/