The PHP date function

The php date function is used to get the current data from the server or the computer system.

Example

[php]<?php
echo "Today is " . date("Y/m/d") . "<br>";
echo "Today is " . date("Y.m.d") . "<br>";
echo "Today is " . date("Y-m-d") . "<br>";
echo "Today is " . date("l");
?>[/php]

Code explanation

y – It represents the year.
m – It represents the month.
d – It represents the Date.
l – The lower case L represent the day.

Outcome

Today is 2018/01/11
Today is 2018.01.11
Today is 2018-01-11
Today is Thursday

Related Posts

Leave a Reply