Alot of links.Mr. Johnson said:Please view my signature.
Tree said:
T.M. said:b) I don't remember writing a RandomColor() function, lol, and if I did then it would be RandomColour()
Does the randomcolor()/randomcolour() randomises the colour anything from #000000 to #FFFFFF.sEp said::readthis:
So its edited? Lol.Tree said:It was originally your randomChar/password function. But I changed it to randomColor.
/**
* @return random_color
* @param null
* @desc Outputs random color
Thanks to: Colin Palmer (t.m., The Moose)
*/
function randomColor()
{
$password = "";
$possible = "0123456789ABCDEF";
$i = 0;
while ($i < 6) {
$char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
if (!strstr($password, $char))
{
$password .= $char;
}
$i++;
}
return $password;
}
/**
* @return human_price
* @param null
* @desc Changes a price (10000) to human readable ($10,000).
Thanks to: Colin Palmer (t.m., The Moose)
*/
function HumanPrice($price) {
$price = strrev(chunk_split (strrev($price), 3, ','));
$price = "$".$price;
if(substr($price, 1, 1) == ",") {
$price = str_replace("$,", "$", $price);
}
if($price == "$") { $price = "$0"; }
return $price;
}
/**
* @return find_ext
* @param null
* @desc finds the extention from a given domain
Thanks to: Colin Palmer (t.m., The Moose)
*/
function FindExt($domain) {
if(substr($domain, -4, 4) == ".com") { $ext = ".com"; }
elseif(substr($domain, -4, 4) == ".net") { $ext = ".net"; }
elseif(substr($domain, -4, 4) == ".org") { $ext = ".org"; }
elseif(substr($domain, -4, 4) == ".biz") { $ext = ".biz"; }
elseif(substr($domain, -5, 5) == ".info") { $ext = ".info"; }
elseif(substr($domain, -7, 4) == ".com") { $ext = substr($domain, -7, 7); }
elseif(substr($domain, -7, 4) == ".org") { $ext = substr($domain, -7, 7); }
elseif(substr($domain, -7, 4) == ".net") { $ext = substr($domain, -7, 7); }
elseif(substr($domain, -6, 3) == ".co") { $ext = substr($domain, -6, 6); }
else { $ext = substr($domain, -3, 3); }
return $ext;
}