io ho in una directory delle foto con il nome del file mmggyy.jpg
io prendo tutti i nomi dei file così
Codice PHP:
$handle = opendir($image_path);
while ($file = readdir($handle)) {
$image_data[] = $file;
}
closedir($handle);
e poi tramite un for stampo a video tutte le immagini.
Il problema sta nel fatto che io vorrei che facesse questa cosa per tutte le immagini contenute nella directory che hanno data da oggi indietro. Ad esempio l'immagine con data 121205 anche se nella directory, non me la mettesse nell'array.
Ho provato a mettere un if prima di $image_data[] = $file; ma non cambia niente
Codice PHP:
$month = substr($file,0,1);
$day = substr($file,2,3);
$year = substr($file,4,5);
$date_image = mktime(0,0,0,$month,$day,$year);
$date_now = time();
if(date_image <= $date_now);{
$image_data[] = $file;
}
}