$ArrayOfJobs = array(); $JobCount = 0; function dirList ($directory) { GLOBAL $ArrayOfJobs; $handler = opendir($directory); while ($file = readdir($handler)) { if ($file != '.' && $file != '..' && Job::ValidateFilename($file)) $ArrayOfJobs[$JobCount++] = new Job($file); } closedir($handler); // done! //return $results; echo "
"; print_r($ArrayOfJobs); echo ""; }