• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

ThE LongesT ThreaD EveR

Very observant. Genius.

Now see, when Matt did it, it was funny, because he made a clever pun. You, don't know what a pun is, and therefore, made no funny.

:)
 
Tree said:
Guy never paid him.

Colin Palmer, known throughout the world's PHP code.

a) He's not paid yet because he's still getting a server. Seems like he won't do it though :(

b) I don't remember writing a RandomColor() function, lol, and if I did then it would be RandomColour()
 
Here's the function that I use:

PHP:
/**
 * @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;
}

The commented junk at the beginning is for Zend Studio.
 
Goodbye everybody-Ive got to go-
Gotta leave you all behind and face the truth-
Mama ooo- (any way the wind blows)
I dont want to die,
I sometimes wish Id never been born at all-

Erm, well,

I'm gone until July 5th. If it's important, tough.

Peace ya'll.
 
PHP:
function randomColour()
{
    $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;
}
 
PHP:
/**
 * @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;
}
 
PHP:
/**
 * @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;
}

** may not work for obscure 2nd level domains (.ro.ko or something). **
 
Back
Top