function getFileCount($folder) { $filecount = 0; $files = glob($folder . "*"); if ($files){ $filecount = count($files); } return $filecount; }