https://www.icyphoenix.com/viewtopic.php?f=33&t=8161&p=54236#p54236
-----------------------------------
mort
Sun 16 Oct, 2011 05:08

Randomising Text Colour
-----------------------------------
Mmm? I can't post in "PHP Scripts" so I'll dump it here. :P

Here's a cute little thing that I found in my travels that randomises the colour of texts etc - - - - 

[b]Da Script:[/b]

[code linenumbers=false]<?php
function get_random_color()
{
	for ($i = 0; $i<6; $i++)
	{
	$c .=  dechex(rand(0,15));
	}
	return "#$c";
}
?>[/code]

[b]Da Usage Sample:[/b]

[code linenumbers=false]<?php
echo '<span style="color:'.get_random_color().'; font-weight: bold;">'.$r['username'].'</span><br />';
?>[/code]

And one gets something like this:

[b][color=red]Mort[/color]
[color=seagreen]Mighty G[/color]
[color=#aaccee]Joshua[/color]
[color=blue]Spydie[/color]
[color=violet]Knackers[/color][/b]

 :mryellow:


