PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I display todays date on my website?


Another common enquiry, and once people did this all the time with JavaScript, if you are running PHP then why not do it through one line of code in your script.

The function you are after is called date, which has loads of different parameters that will return different elements of the date. For a full list, be sure to check out the manpage on the www.php.net site.

However to the question in hand:

<?php
$today 
date('F j, Y');
echo 
"Todays date is: $today";
//Todays date is: Sep 18, 2007
?>



Comment on this Question and Answer >>>

ASK A QUESTION

More website PHP Questions

is there any sendemail function in php for sending contents of a form through email?

I have two web solutions I downloaded from the internet. Jobs Portal, Classified and a forum script. Each of the scripts has its own signup and log in module. How can I make visitors register and login through one webpage without having to login in all th

How do I find a visitors IP address?

my web site www.innovativephp.com is not configured properly to dns how can i do that?

How do I keep my site menu in one file?



Custom Search