May 1, 2009

PHP Date

We have had a few emails asking about simple PHP dates for copyright footers and having the date as part of a navigation so we thought we would post a little info pack about PHP dates.

Adding the year as part of the copyright is a great idea as it makes one less thing you have to change each year of your website. 1 more thing of the “To do List”

The simple way of getting the date and outputing it to the screen is using the example provided from PHP.NET shown below:

Source PHP.NET

<?php
$today
=

getdate();
print_r($today);
?>

To do a year only for copyright footers like we have on our website you can use:
<?php echo date(‘Y’); ?>
Hope you find this tiny bit of code handy for your website.

Join the conversation! 1 Comment

  1. Hostmediauk…

    […] something about hostmediauk[…]…

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

About Host Media

We have been hosting websites since 2002 and are always moving forward. All articles written under the Host Media author are created by the team who support our customers.

Category

PHP & MySQL

Tags

, , , ,