How can the age of a file be calculated in PHP using Unix timestamps?

To calculate the age of a file in PHP using Unix timestamps, you can get the current Unix timestamp using `time()` function and then use `filemtime()` function to get the Unix timestamp of the file's last modification time. You can then subtract the file's timestamp from the current timestamp to get the age of the file in seconds, which can be converted to days, hours, minutes, etc. as needed.

$file = 'path/to/your/file.txt';
$current_time = time();
$file_time = filemtime($file);
$age_seconds = $current_time - $file_time;

$age_days = floor($age_seconds / (60 * 60 * 24));
$age_hours = floor($age_seconds / (60 * 60));
$age_minutes = floor($age_seconds / 60);

echo "File age: $age_days days, $age_hours hours, $age_minutes minutes";