viewing paste Unknown #33073 | PHP

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php
  $files = glob("~/backup/*");
  $now   = time();
 
  foreach ($files as $file)
  {
    if (is_file($file))
    {
      if ($now - filemtime($file) >= 60 * 60 * 24 * 10) // 10 days
      {
        unlink($file);
      }
    }
  }
?>
Viewed 958 times, submitted by Guest.