if (time()-filemtime($filename) > 2 * 3600) {
// file older than 2 hours
} else {
// file younger than 2 hours
}
Related Contents:
- What is the use of the @ symbol in PHP?
- How to add elements to an empty array in PHP?
- What is a Python equivalent of PHP’s var_dump()? [duplicate]
- How do I check if a directory exists? “is_dir”, “file_exists” or both?
- Traits vs. interfaces
- PHP exec() vs system() vs passthru()
- Get absolute path of initially run script
- How to fix error with xml2-config not found when installing PHP from sources?
- CodeIgniter activerecord, retrieve last insert id?
- Highlight the difference between two strings in PHP
- Performance of FOR vs FOREACH in PHP
- How to make PDF file downloadable in HTML link?
- PHP Multidimensional Array Searching (Find key by specific value)
- MySQL – This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery
- Warning about `$HTTP_RAW_POST_DATA` being deprecated
- json_encode/json_decode – returns stdClass instead of Array in PHP
- Regex plus vs star difference? [duplicate]
- Why do I have to run “composer dump-autoload” command to make migrations work in laravel?
- MySQL connection not working: 2002 No such file or directory
- Convert seconds into days, hours, minutes and seconds
- How to repair a serialized string which has been corrupted by an incorrect byte count length?
- Getting the name of a child class in the parent class (static context)
- Manipulate a url string by adding GET parameters
- How to use cURL to get jSON data and decode the data?
- CodeIgniter – accessing $config variable in view
- Installing PDO driver on MySQL Linux server
- If isset $_POST
- How can I implement an Access Control List in my Web MVC application?
- Changing upload_max_filesize on PHP
- how to create virtual host on XAMPP [duplicate]
- Is == in PHP a case-sensitive string comparison?
- How unique is the php session id
- Update without touching timestamps (Laravel)
- cURL code in PHP dumps output to the page
- Differences and dis/advanages between: Fast-CGI, CGI, Mod-PHP, SuPHP, PHP-FPM
- Make PhpStorm stop automatically closing tabs
- What is the best way to read last lines (i.e. “tail”) from a file using PHP?
- get next and previous day with PHP
- Call to a member function on a non-object [duplicate]
- JavaScript equivalent of PHP’s preg_replace
- What is the best way to create a random hash/string?
- Do you name your arrays using plural or singular in PHP? [closed]
- How to safely output HTML from a PHP program?
- Truncate a table in Laravel 5
- What is the difference between PEAR and Composer?
- How do I get WKHTMLTOPDF to execute via PHP?
- Address in mailbox given [] does not comply with RFC 2822, 3.6.2. when email is in a variable
- get first and last element in array
- PHP – recursive Array to Object?
- How do I use a class method as a callback function?