24/7 Live Chat Support
  • 24/7 Support
  • UK based: (+44) 0800 0488 186
  • US based: (570) - 445-3230
 // you're reading...

PHP & MySQL

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.

Discussion

Trackbacks/Pingbacks

  1. Hostmediauk…

    [...] something about hostmediauk[...]…

    Hostmediauk - January 10, 2011

Post a Comment


9 + = 14