You can let the visitors know when you last modify or update a page by following using this very simple code snippet.
- You can include this piece of code where you want the “Last Update” part to appear;
<?php
echo “Last Update: ” . date(”jS F Y”, getlastmod());
?>
echo “Last Update: ” . date(”jS F Y”, getlastmod());
?>
Where j is for day, S is for day’s suffix, F is month, and Y is for year.
…which will result as the following;
Last Update: 7th December 2009
- You can change the date style by changing the “jS F Y” part according to PHP date format.
- For example, these lines of codes;
<?php
echo “Last Update: ” . date(”d/m/y”, getlastmod());
?>
echo “Last Update: ” . date(”d/m/y”, getlastmod());
?>
…will result as the following;
Last Update: 07/12/09
- Or with these lines of codes;
<?php
echo “Last Update: ” . date(”d M Y”, getlastmod());
?>
echo “Last Update: ” . date(”d M Y”, getlastmod());
?>
…will result as the following;
Last Update: 07 Dec 2009
Comment?
»
Leave a comment
ajwa . Naj . Wawa . 26 . 











