Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

How get one week date using PHP

php mysql
How get one week date using PHP

This is a short guide on how to get the date of the week from a monday to sunday in PHP. This is useful for whenever you need to figure out what date a particular date fell on (or will fall on in the future). In this tutorial, I will be retrieving the date from a YYYY-MM-DD string.


$data ['monday']    = date( 'Y-m-d', strtotime('monday this week'));
$data ['tuesday']   = date( 'Y-m-d', strtotime('tuesday this week'));
$data ['wednesday'] = date( 'Y-m-d', strtotime('wednesday this week'));
$data ['thursday']  = date( 'Y-m-d', strtotime('thursday this week'));
$data ['friday']    = date( 'Y-m-d', strtotime('friday this week'));
$data ['saturday']  = date( 'Y-m-d', strtotime('saturday this week'));
$data ['sunday']    = date( 'Y-m-d', strtotime('sunday this week'));


Html code work in comment box

Related Post