erme Posted July 28, 2010 Share Posted July 28, 2010 I currently have $_SERVER['REQUEST_URI'] which echos /dir/page etc How can I modify it so it only echo's /dir/ Otherwords I want to lose the page. Quote Link to comment Share on other sites More sharing options...
erme Posted July 28, 2010 Author Share Posted July 28, 2010 Should be fairly simple but I can't seem to sort it Quote Link to comment Share on other sites More sharing options...
erme Posted July 28, 2010 Author Share Posted July 28, 2010 Fixed it myself $path = $_SERVER['SCRIPT_NAME']; $basename = basename($_SERVER['SCRIPT_NAME']); $url = $path; $newurl = str_replace($basename, "", $url); echo "$newurl"; 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.