got help from http://www.eliteskills.com/ who came up with...
<?
$url = "http://about.wipro.com.au/index.asp?a=bg.v&bs";
echo "In: $url";
$url=preg_replace("/((http(s)?|ftp):\/\/)/", "", $url);
$url=preg_replace("/([\/]+)(.*)/", "\1", $url);
$urlcount = explode(".",$url);
$urlcount1 = count($urlcount);
$urlcount1--;
if (ereg("(.co.|.ca.|.com.|.org.|.net.)", $url)){
$urlcount1--;
}
$url=preg_replace("/([.]+)./i", "", $url,$urlcount1-1);
echo "<br />Out: $url";
?>
only problem is with the part where I have to put in the tlds to look for. I would like to skip that step, so I can allow for ANY tld.