$url = "http://www.rntsoft.com";
$www_url = ereg("^(http://www)\.([[:alnum:]]+)\.([[:alnum:]]+)", $url, $regs);
if ($www_url) :
echo $regs[0];
print "
";
echo $regs[1];
print "
";
echo $regs[2];
print "
";
echo $regs[3];
endif;
?>