I wrote this php script to delete old files older than 24 hrs, but it deleted all the files including newer ones:
86400){ unlink($file); } } ?>
You can also specify file type by adding an extension after the * (wildcard) eg
For jpg images use: glob($dir."*.jpg")
glob($dir."*.jpg")
For txt files use: glob($dir."*.txt")
glob($dir."*.txt")
For htm files use: glob($dir."*.htm")
glob($dir."*.htm")