Get day and date using php

Date and time are some of the most frequently used operations in PHP while executing SQL queries or designing a website etc. PHP serves us with predefined functions for these tasks. Some of the predefined functions in PHP for date and time are discussed below.

echo date(‘d’);   // date display.

echo date(‘D'); // day display.

echo date(‘1’); / first day of week.

$last_date = date("t", strtotime(date(‘Y-m-d')); 

Leave a Reply