Jump to content

[SOLVED] PHP - Get Last folder Name?


Gamerz

Recommended Posts

How do I get the last foldername via a php code?

 

For example: If my directory is: /test/users/gamerz/index.php then I want the code to detect and echo out gamerz, as gamerz is the last folder name on that directory...And also I don't want the slashes (/gamerz) or (gamerz/) just plain last foldername.

Link to comment
https://forums.phpfreaks.com/topic/168878-solved-php-get-last-folder-name/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.