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? Link to comment https://forums.phpfreaks.com/topic/223691-get-current-directory-only-part-the-user-sees/ 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()) Link to comment https://forums.phpfreaks.com/topic/223691-get-current-directory-only-part-the-user-sees/#findComment-1156300 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.