Hello,
I'm trying to make http://www.mysite.com/page.php look like www.mysite.com. I can get rid of the [url]http://[/url] by using the following code:
$var = eregi_replace("http://","",$site_url);
Now my question is, how do I take $var and replace the rest of the URL string (everything after .com) ?
To add more confusion, there might be hundreds of these URL names in the database. Not all will be the same length (if that matters) and not all will end in .com. Some might be .net or .biz, etc. I've looked at preg and str, etc. but just can't seem to get it working right.
Can someone please provide a code sample. Thanks much.