<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$dp = opendir($dir) or die ('Could not open '.$dir);
while ($file = readdir($dp))
{
    if ((filemtime($dir.$file)) < (strtotime('-10 days')))
    {
        echo "<br> File Name :: ".$dir.$file;
        unlink($dir.$file);
    }
}
closedir($dp);

?>
