-2

次のコードがあります。

$days = 7;   

// Check if the file is older than X days old  
if (filemtime($path.$file) < ( time() - ( $days * 24 * 60 * 60 ) ) )  
{  
    // Do the deletion  
    unlink($path.$file);  
}

$daysに変更したいのですが$minute、どうすれば変更できますか?

4

2 に答える 2

0

ファイルがx分より古いかどうかを確認する場合は、次のコードが適用される可能性があります。

$minutes = 15;

// Check if the file is older than x minutes
if (filemtime($path.$file) < ( time() - ( $minutes * 60 ) ) ) {  
    // Do the deletion  
    unlink($path.$file);  
}
于 2015-12-15T03:04:15.353 に答える