How do you get an array of the date and time?
To do this you use the handy getdate function, like this:
<?php
$date = getdate();
echo $date['month'];//September
?>
There are a range of keys available to you in the associative array that results from calling getdate, for the full list check out the page on www.php.net - the most useful are year,month,mday,hours,minutes,seconds
Comment on this Question and Answer >>>
ASK A QUESTION
More other PHP Questions
What is the difference between sessions and cookies?Can I spellcheck my text using PHP?
How do I add comments to my PHP script?
I have lots of if else logic - is there another option?
What is the difference between the while and do while loops?
