Heyoooo-
From php.net:
What on EARTH are all those dashes slashes and carots? I know I will eventually need the preg_match but sheesh... I'm gettin dizzy....
From php.net:
PHP Code:
<?php
// get host name from URL
preg_match("/^(http:\/\/)?([^\/]+)/i",
"http://www.php.net/index.html", $matches);
$host = $matches[2];
// get last two segments of host name
preg_match("/[^\.\/]+\.[^\.\/]+$/", $host, $matches);
echo "domain name is: {$matches[0]}\n";
?>

Comment