RE: [PHP] preg_replace question
| From: | Dan Rossi | Date: | Wed, 20 Nov 2002 21:29:31 +0000 |
| Subject: | RE: [PHP] preg_replace question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125332@lists.php.net to get a copy of this message | ||
thats the thing the urls should be able to parse http:// or www or both and
i have to unfortunatly clean up a forced port and directory in the url
aswell for gethostname to work
-----Original Message-----
From: 1LT John W. Holmes [mailto:holmes072000@charter.net]
Sent: Thursday, November 21, 2002 7:48 AM
To: shiflett@php.net; electroteque; php-general@lists.php.net
Subject: Re: [PHP] preg_replace question
> --- electroteque <daniel@electroteque.org> wrote:
> > how could i remove http://www. ot of a url string using
> preg_replace?
>
> No need to reinvent the wheel for this. Just use parse_url() instead:
>
> http://www.php.net/manual/en/function.parse-url.php
>
Or just str_replace(). No need for regular expressions.
http://www.php.net/manual/en/function.str-replace.php
---John Holmes...