Okay, I am (attempting) making a gallery php script. I have a very simple problem with it. I will be storing the path from the root of the gallery in $folder. But how would I get to the previous folder?
$folder will be something like this : "/data/wp/abstract", or just "/data/wp". So, if I split it up like this :
list( $up[0] , $up[1], $up[2], $up[3], $up[4] ) = split( '[/]', $folder );
it would split it into the parent folders (hopefully?), but how would I know which to use? Maybe a regex search or something(i don't know what Im saying) for how many occurences of a "/" there is, and using that value minus 1 to get to the previous folder from the $up[''] array? Hopefully you can understand my question.