questa è la funzione:

Codice PHP:
function directory_list_2($path$types="directories"$recursive=0) {
 
__ 
 __ 
// get a list of just the dirs and turn the list into an array 
 
__ // @path_ _ _ _ starting path from which to search
 
__ // @types_ _ _ _ can be "directories", "files", or "all"
 
__ // @recursive_ _ determines whether subdirectories are searched
 
__ 
 __ 
if ($dir opendir($path)) {
 
__ _ _ $file_list = array();
 
__ _ _ while (false !== ($file readdir($dir))){
 
__ _ _ _ _ // ignore the . and .. file references
 
__ _ _ _ _ if ($file != '.' && $file != '..') {
 
__ _ _ _ _ _ _ // check whether this is a file or directory and whether we're interested in that type
 
__ _ _ _ _ _ _ if ((is_dir($path."/".$file)) && (($types=="directories") || ($types=="all"))) {
 
__ _ _ _ _ _ _ _ _ _ _ $file_list[] = $file;
 
__ _ _ _ _ _ _ _ _ _ _ // if we're in a directory and we want recursive behavior, call this function again
 
__ _ _ _ _ _ _ _ _ _ _ if ($recursive) {
 
__ _ _ _ _ _ _ _ _ _ _ _ _ $file_list array_merge($file_listdirectory_list($path."/".$file."/"$types$recursive));
 
__ _ _ _ _ _ _ _ _ _ _ }
 
__ _ _ _ _ _ _ } else if (($types == "files") || ($types == "all")) {
 
__ _ _ _ _ _ _ _ _ $file_list[] = $file;
 
__ _ _ _ _ _ _ }
 
__ _ _ _ _ }
 
__ _ _ }
 
__ _ _ closedir($dir);
 
__ _ _ return $file_list;
 
__ } else {
 
__ _ _ return false;
 
__ }
 
__ 
 


direi abb elementare... ma se chiamo la pagina che lo contiene mi da un "parse error", ed è abb strano (almeno a me non è mai capitato!!) xkè l'errore me lo dà anke se non invoco la funzione....mi dice sempre che alla linea 5 c'è 'sto benedetto errore di parsing.......boh

Suggerimenti???