note 18707 deleted from function.ereg-replace by kennyt
| From: | kennyt@php.net | Date: | Wed, 26 Jan 2005 03:57:12 +0000 |
| Subject: | note 18707 deleted from function.ereg-replace by kennyt | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-83998@lists.php.net to get a copy of this message | ||
Note Submitter: miha at sonce dot net
----
If anybody wants to strip the domain name and protocol from url and get just the path on the server,
this should do it:
$url = "http://www.sonce.net/index.php";
echo "Url: ".$url;
$new = eregi_replace("^(.{2,6}://)?[^/]*/", "", $url);
echo "Path: ".$new;