1. Computing

Discuss in my forum

Today's Date using PHP

Display the Current Date on Your Website

By , About.com Guide

The current date can be displayed using the single line of code below. This will only work on pages where PHP is enabled. This means that it will display a date on pages that end in .php (you can name your HTML page to have a .php extension) or other extensions setup on your server to run PHP.
 <? print(Date("l F d, Y")); ?> 
Here is how it works:

  1. The scripts starts by opening up the PHP code with the <? symbols.

  2. Next, it uses the print function to send the date it is about to generate to the browser.

  3. The date function is then used to create today's date.

  4. Finally, the PHP script is closed using the ?> symbols.
Related Video
Using PHP With HTML
Basic PHP Syntax
  1. About.com
  2. Computing
  3. PHP / MySQL
  4. Step By Steps
  5. Display Current Date - PHP HTML Current Date

©2013 About.com. All rights reserved.