Wie bekomme ich ein array aus einer funktion?
Eigentlich sollte das doch so stimmen?
	
							
						
					Eigentlich sollte das doch so stimmen?
PHP-Code:
	
	
<?php
function scan_dir ($dir) {
  if ($handle = opendir($dir)) {
      while (false !== ($res = readdir($handle))) {
          if (is_dir($dir.$res) && $res != '.' && $res != '..') {
            $res_d = $res;
            $array_dir[$res_d] = $res_d;
            // echo ' dir-'.$dir.$res.' ';
            // scan_dir ($dir.$res.'/');
          }
          elseif (is_file($dir.$res)) {
            $res_f = $res;
            $array_file[$res_f] = $res_f;
            // echo ' File-'.$res.' ';
          }
      }
      closedir($handle);
  }
  ksort($array_dir);
  ksort($array_file);
  return array($array_dir,$array_file);
}
?>
<?php
  include("./code/config/config.ini");
  include("./code/include/scan_dir.icl");
  scan_dir ($original_dir);
  foreach ($array_dir as $key) {
    echo ($array_dir);
    echo '<br />';
  }
?>
 
          
 Ich wollte es nur der Vollständigkeit halber erwähnt haben.
 Ich wollte es nur der Vollständigkeit halber erwähnt haben.
							
						
Kommentar