how to get 4-days ago to now - php

Viewed 5095

If current date is 2016-03-06, I would like to get these dates :

2016-03-06
2016-03-05
2016-03-04
2016-03-03

I'm trying to get this purpose but my result not what I want :

$_4date = date("y-m-d",strtotime("day"));
$_3date = date("y-m-d",strtotime("-1 day"));
$_2date = date("y-m-d",strtotime("-2 day"));
$_1date = date("y-m-d",strtotime("-3 day"));

echo $_4date;
echo '<br />';
echo $_3date;
echo '<br />';
echo $_2date;
echo '<br />';
echo $_1date;

the result is :

70-01-01
16-03-05
16-03-04
16-03-03
5 Answers
Related