How to Get Yesterday’s Date Using PHP

Here are some methods to get yesterday’s date using php.

$yesterday = date('d/m/Y',strtotime("-1 days"));

This will return format like 19/02/17. You can get more details from PHP’s date function

You can change the -1 to -20 to get the 20 days back.

Editorial Staff

Editorial Staff at tutsplanet is a dedicated team to write various tutorial articles.