Skip to content

Instantly share code, notes, and snippets.

@frikishaan
Created January 2, 2022 13:08
Show Gist options
  • Save frikishaan/98b2696895745613cbde231d5a73cfd6 to your computer and use it in GitHub Desktop.
Save frikishaan/98b2696895745613cbde231d5a73cfd6 to your computer and use it in GitHub Desktop.
Generate random color hex code in PHP
<?php
function generateHexColor() : string
{
return substr(str_shuffle('ABCDEF0123456789'), 0, 6);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment