Forum Moderators: coopster
I would like to reduce the result of date () but it doesn't seem to work.
The way I do is like this:
$day = date('M dS'); // show "Feb 24th"
In order to get, for example, "Feb 20th", then I tried:
echo date('M dS') - 4;
or
echo $day - 4;
but it can't show "Feb 20th".
Does anyone know how to do it? Thanks a lot!
Since strtotime produces timestamps, you can combine the two, using strtotime to provide the timestamp:
date("M dS",strtotime('-4 days'));