I'm trying to get a future date from today using PHP.
like date('dS M, Y (D)') returns 21st Jan, 2021 (Thu) (Today)
date('dS M, Y (D)')
How can we get a future date from today!
You could use PHP's DateTime class:
$dt = new DateTime(); $dt->modify( '+10 days' ); echo $dt->format( 'dS M, Y (D)' );
https://www.php.net/manual/en/book.datetime.php
2.1m questions
2.1m answers
60 comments
57.0k users