rajaseeth Posted November 3, 2009 Share Posted November 3, 2009 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 Link to comment https://forums.phpfreaks.com/topic/180142-how-to-get-the-url-string/ Share on other sites More sharing options...
ILMV Posted November 3, 2009 Share Posted November 3, 2009 This should do it: $_SERVER['SERVER_ADDR']; Link to comment https://forums.phpfreaks.com/topic/180142-how-to-get-the-url-string/#findComment-950309 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.