note 37212 deleted from function.readdir by tularis

From: Date: Sun, 13 May 2007 19:06:22 +0000
Subject: note 37212 deleted from function.readdir by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-126548@lists.php.net to get a copy of this message
Note Submitter: bermi_ferrer {:at:} bermi {:dot:} org ---- Simple function to recursively load given directory (/full_path/to_directory/) into an array. function akelos_recursive_dir($directorio) { if ($id_dir = opendir($directorio)){ while (false !== ($archivo = readdir($id_dir))){ if ($archivo != "." && $archivo != ".."){ if(is_dir($directorio.$archivo)){ $resultado[$archivo] = akelos_recursive_dir($directorio.$archivo."/"); } else{ $resultado[] = $archivo; } } } closedir($id_dir); } return $resultado; }

« previous php.notes (#126548) next »