Advertisement
ipsBruno

(PHP) Deletar arquivos inutilizados

Feb 10th, 2013
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2.     //
  3.     // Deletar arquivos inutilizados a mais de 1 semana
  4.     // Por Bruno da Silva
  5.     // facebook.com/ipsBruno
  6.     //
  7.  
  8.     $pasta = "teste"; // pasta dos jogadores
  9.  
  10.     $handlepasta = opendir($pasta);
  11.  
  12.     while(($nickname = readdir($handlepasta)) !== false) {
  13.         if(($nickname !=".") && ($nickname !="..") && ($nickname != "index.htm") && ($nickname !="info")) {
  14.        
  15.             $segundos = (int) time()-filemtime($nickname);
  16.  
  17.             if($segundos > 604800) {
  18.                 echo "A conta <b>$nickname</b> não entra a 1 semana";
  19.                 echo "<br/>";
  20.             }
  21.  
  22.         }
  23.     }
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement