jeff5656 Posted January 7, 2011 Share Posted January 7, 2011 I have a page site.com/register/signup.php I want to echo out the current directory: register. When I use getcwd() I get: /home/user1234/public_html/register instead of: register or if I am inside this directory site.com/register/image/ then I want to echo out: register/image I have also tried the server[self] command but that too gives you the full directory. Does anyone know how to echo out only the current directory starting AFTER the public_html? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 7, 2011 Share Posted January 7, 2011 This should do it for you. basename(getcwd()) 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.