note 20183 deleted from function.ereg-replace by kennyt
| From: | kennyt@php.net | Date: | Wed, 26 Jan 2005 03:56:48 +0000 |
| Subject: | note 20183 deleted from function.ereg-replace by kennyt | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-83996@lists.php.net to get a copy of this message | ||
Note Submitter:
----
I tried the expression from miha@sonce.net, but it was problematic because it assumes that you have
a full URL. I needed to check user form data and strip out the protocol and server name if present.
This worked for me:
$newurl = eregi_replace("^(http://)[^/]+/", "", $url);