Jump to content

getting previous directory name


brem13

Recommended Posts

ok, im trying to figure out how to link to a previous directory, like i know i can use

"$dirname = basename(dirname(__FILE__));" to get the name of the current directory. but say  the folders are /public_html/galleries/members/ADMIN/RANDOM <----- RANDOM is the current directory, but how would i write code to take the previous directory 'ADMIN' and put it in a variable????? ive tried "$dirname = basename("../".dirname(__FILE__));" and stuff like that, but it doesnt work?????

any help is greatly appreciated  :)

Link to comment
https://forums.phpfreaks.com/topic/145579-getting-previous-directory-name/
Share on other sites

thank you and it kindof works, somehow it puts 'array' into the link for all but one picture.

the first picture is fine "galleries/members/BREMINEM/RANDOM/1234963429.jpg",

and all the rest are like this now "galleries/members/ADMIN/RANDOM/Array/1234920795.jpg"

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.