Page 1 of 1

How to get the URL string?

Posted: Tue Nov 03, 2009 9:48 am
by rajaseeth
Hi,

I am new to PHP. I have a requirement. I have a url as http://localhost/TestApplication/Test.php. From the above url i want only "http://localhost". is there a method to get it?.

Thanks,
Raja

Re: How to get the URL string?

Posted: Tue Nov 03, 2009 10:32 am
by AbraCadaver

Code: Select all

var_dump($_SERVER);

Re: How to get the URL string?

Posted: Tue Nov 03, 2009 10:51 am
by Reviresco