What is the difference between filectime() and filemtime() in PHP when retrieving timestamps?

The main difference between filectime() and filemtime() in PHP when retrieving timestamps is that filectime() returns the inode change time of a file, which is when the file's metadata (permissions, owner, etc.) was last changed, while filemtime() returns the time when the file's content was last modified. To retrieve the last modification time of a file, you should use filemtime().

// Retrieve the last modification time of a file using filemtime()
$file = 'example.txt';
$lastModifiedTime = filemtime($file);

echo "Last modified time of $file: " . date('Y-m-d H:i:s', $lastModifiedTime);