How can I display the last modification date of my website using PHP?
To display the last modification date of your website using PHP, you can use the filemtime() function to get the timestamp of the last modification of a specific file, such as your index.php file. You can then format this timestamp using the date() function to display it in a human-readable format on your website.
<?php
$last_modified = filemtime('index.php');
echo "Last modified: " . date("F d Y H:i:s.", $last_modified);
?>
Keywords
Related Questions
- What tools or software can be used to create a self-contained PHP application that doesn't require a server?
- In what ways can a centralized installation or setup script improve the process of customizing a PHP script for different users?
- What potential pitfalls should be considered when trying to extract column names from a table in PHP?