LEARN TO CODE

View Original

Getting the Current Date in PHP

In this brief lesson we look at how we can obtain the current date in PHP.

There are several methods but the easiest is to just use the date() function with passed in parameters.

For example, we can use 'Y-m-d' to represent the Year, month and day:

See this content in the original post

The output will be:

See this content in the original post

If you would like to learn more about PHP then enrol in the PHP for Beginners course.