I've been trying to do a function that could delete files from within a given directory according to an informed date. In this example I have not yet created the function because I am still trying to understand how it is done.
echo "<br />";
$arquivo = 'documento.pdf';
if(date("November 05 2016 19:19:24.", fileatime($arquivo))){
echo "Excluiu!";
unlink($arquivo);
} else {
echo "Não excluiu!";
}
A very basic example of what I'm trying to do is delete files from a folder that have been in it for more than 3 months. I can not understand how I can spend this time and use it as a parameter in a function (because I can change the time if I need to)