update page now
Longhorn PHP 2026 - Call For Papers

Voting

: max(eight, three)?
(Example: nine)

The Note You're Voting On

avi dot megladon at gmail dot com
13 years ago
loop through folders and sub folders with option to remove specific files.

<?php
function listFolderFiles($dir,$exclude){
    $ffs = scandir($dir);
    echo '<ul class="ulli">';
    foreach($ffs as $ff){
        if(is_array($exclude) and !in_array($ff,$exclude)){
            if($ff != '.' && $ff != '..'){
            if(!is_dir($dir.'/'.$ff)){
            echo '<li><a href="edit_page.php?path='.ltrim($dir.'/'.$ff,'./').'">'.$ff.'</a>';
            } else {
            echo '<li>'.$ff;    
            }
            if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff,$exclude);
            echo '</li>';
            }
        }
    }
    echo '</ul>';
}

listFolderFiles('.',array('index.php','edit_page.php'));
?>

<< Back to user notes page

To Top