Vivid Lust Posted July 21, 2008 Share Posted July 21, 2008 Say i was on a page: http://www.mysite.com/dir/dir/index.php how would i get using php: http://www.mysite.com ??? Thanks in advanced for the help. Quote Link to comment Share on other sites More sharing options...
matmunn14 Posted July 21, 2008 Share Posted July 21, 2008 Use $_SERVER["HTTP_HOST"] Quote Link to comment Share on other sites More sharing options...
-entropyman Posted July 21, 2008 Share Posted July 21, 2008 try this: <?php $url = 'http://www.google.com/'; print_r(pathinfo($url)); // all the arrays // or try $parts = pathinfo($url); echo "$parts[basename]"; // just array you want ?> http://us.php.net/manual/en/function.pathinfo.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.