Skip to content

Instantly share code, notes, and snippets.

@NassimRehali15
Forked from agarzon/random_color.php
Last active June 16, 2019 10:50
Show Gist options
  • Save NassimRehali15/d0e86206cfa4a7912f449459ae89d5d4 to your computer and use it in GitHub Desktop.
Save NassimRehali15/d0e86206cfa4a7912f449459ae89d5d4 to your computer and use it in GitHub Desktop.
PHP Random Color Generator Hex
<?php $color = '#'.dechex(rand(0x000000, 0xFFFFFF)); ?>
<body style="background-color: <?php echo $color; ?>;">
<h1><?php echo $color ?></h1>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment