Re: Re: URL output query
| From: | Chris | Date: | Tue, 28 Feb 2006 05:47:33 +0000 |
| Subject: | Re: Re: URL output query | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231184@lists.php.net to get a copy of this message | ||
Rafael wrote:
We are two different people !? Not sure how that's difficult. I don't know why you'd use a regular expression when you can use a function instead (easier to maintain, it'll be faster, you won't make a mistake)... But of course there is always more than one way to solve a problem. -- Postgresql & php tutorials http://www.designmagick.com/Hi Chris, if the only thing you want is to get the domain (having the whole URL) you have more than one way to solve it. Chris -it's a little akward that Chris answered to Chris- already told you about parse_url(), and since we're talking about strings, I would suggest something like$domain = preg_replace('{^([a-z]+://[^/]+).*$}X', '%1', $uri); Chris wrote:Greetings PHP folks, Which PHP function do I use if I want to achieve the following : http://www.somesite.com/gallery/pics.php is the url...how do I get it to read only http://www.somesite.com in the browser address bar without the rest of the directory and filename appearing ?