Rafael wrote:
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 ?
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/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php