Getting Today's Date

To access the current date and time, use the date function. This uses the format date (format) where format is a code used to format the date/time returned. The possible values for the format are given in the more detail section on the right. Here are some examples:

$today = date(Ymd);
// Gives $today the date like 20061205

Next article: Files

Manipulating Dates

Next article: Files


The previous article tells you how to use arrays in PHP.


The next screen gives you a tutorial on how to use the file functions in PHP.
This tutorial tells you how to create files, write to them, read from them and delete them.

External Links


  • Create an array using the key values and a value for each element
  • Add to the end of a numeric array using []
  • Retrieve an element in an array using its key
  • Use count to find out how many elements are in an array