Im trying to read filenames from a directory using the code and adding a filter to readonly files with the current year and month in the filename for example
Julius Robles_Client11_20130508_10-42-42_AM.zip
Julius Robles_Client12_20130508_11-45-42_AM.zip
Julius Robles_Client13_20130508_11-58-42_AM.zip
so the code will only return files with 201305 in their names but it returns a correct filtered set but some files are missing and i dont know why?
also what is the file "." and ".." stored in the first 2 rows of the array?
heres the code
$filenames = array();
if ($handle = opendir('archive/search_logs/')) {
$ctr = 0;
while (false !== ($entry = readdir($handle))) {
//if(strpos($entry,date('Ym')) !== false){
$name = $entry;
$entry = str_replace("-",":",$entry);
$filenames[$ctr] = explode("_", $entry);
$filenames[$ctr][] = $name;
$ctr++;
//}
}
closedir($handle);
}