TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Listing folders in list box, folder only, recursively (http://www.talkphp.com/general/4642-listing-folders-list-box-folder-only-recursively.html)

Peuplarchie 06-28-2009 08:36 PM

Listing folders in list box, folder only, recursively
 
Good day to you all,

I'm working on a piece of code which list directory into a dropdown box.
No problem, with that :

PHP Code:




<p>List Box - Single Select<br>
<select name="listbox" size="1">
<option  selected>Click here to see them by themes</option>
<?PHP

if ($handle opendir('themes/')) {
    while (
false !== ($file readdir($handle))) {
        if (
$file != '.' && $file != '..') {
            
$fileName str_replace('.mov'''$file);
            echo 
'<option value="' $file '">' $fileName '</option>';
        }
    }
    
closedir($handle);
}




?>

</select>
</p>



Now what I would like to do is :

1- Read the directory recursively .


Thanks !

Salathe 06-28-2009 08:59 PM

Do you know a) how to create functions, and b) how to make one recursive? Knowing such would be a good guide for us to help you.


All times are GMT. The time now is 03:01 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0