All pastes #2104041 Raw Edit

Unnamed

public php v1 · immutable
#2104041 ·published 2012-01-19 12:02 UTC
rendered paste body
    function browse_folder ($root = "."){        $return = array();        $dir = scandir( $root );        foreach($dir as $possible){            if(($possible == ".") || ($possible == "..") || ($possible == ".idea") ){                continue;            }            if(is_dir($root . "/" . $possible . "/")){                //$return['dirs'][] = $root."/".$possible;                $arr = browse_folder($root . "/" . $possible);                #print_r($arr);                $return = array_merge($return, $arr);            }            if(is_file($root . "/" . $possible)){                $return[] = $root . "/" . $possible;            }        }        return $return;    }