Paramjeet Paramjeet - 14 days ago 5
PHP Question

Get date for a specific day which is after today's date

If I have date like 22-11-2016(d-m-Y) and the day is Saturday for whom I have to search the date and it would be 26-11-2016(d-m-Y). So How to get it?

Answer

If you want to get next week day's date than might be this can help you.

date('d-m-Y', strtotime('next saturday'));

Or also you can use PHP date object as below.

// Create a new DateTime object
$date = new DateTime('22-11-2016');

// Modify the date it contains
$date->modify('next saturday');

// Output
echo $date->format('d-m-Y');
Comments