The above example will output:PHP Code:<?php
// get host name from URL
preg_match('@^(?:http://)?([^/]+)@i',
"http://www.php.net/index.html", $matches);
$host = $matches[1];
// get last two segments of host name
preg_match('/[^.]+\.[^.]+$/', $host, $matches);
echo "domain name is: {$matches[0]}\n";
?>
domain name is: mmorpgcore.com
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks