|
Posted by deko on 12/17/11 11:56
here's a cleaner example:
if (eregi("http://", $mystring))
{
$mystring = explode("http://", $mystring);
$mystring = array_reverse($mystring);
$domain = $mystring[0];
$domain = explode(".", $domain);
if ($domain[0] == "www")
{
$extracted = $domain[1].".".$domain[2];
}
else
{
$extracted = "$domain[0].".".$domain[1];
}
}
Can I egrep on "http://" ? or do I need to escape the "/" ?
Navigation:
[Reply to this message]
|