i have a directory called 'images' and there are subdirectories like 'images/dir1/end/' , 'images/dir2/' and 'images/dir5/dir65/dr/'
Now i'd like to get the pathnames into an array only for these deepest subdirectories that are under the images directory.
So I only want pathnames for these 'images/dir1/end/' , 'images/dir2/' and 'images/dir5/dir65/dr/', not the ones like 'images' or 'images/dir5' or 'images/dir5/dir65'.
Any easy solutions for this?
Thanks a lot.
how to get the subdirectory paths into an array
Moderator: General Moderators
-
purpleglow
- Forum Newbie
- Posts: 1
- Joined: Sun Oct 18, 2009 8:14 am
Re: how to get the subdirectory paths into an array
If you know how to find the path names or strings you can use these functions to extract paths:
http://www.php.net/manual/en/function.dirname.php
http://www.php.net/manual/en/function.pathinfo.php
If you're looking for a way to find the paths because you don't know them all try glob()
http://php.net/manual/en/function.glob.php
There are some examples showing how to search out the directory trees.
http://www.php.net/manual/en/function.dirname.php
http://www.php.net/manual/en/function.pathinfo.php
If you're looking for a way to find the paths because you don't know them all try glob()
http://php.net/manual/en/function.glob.php
There are some examples showing how to search out the directory trees.