Previous 20 days of the date calendar PHP Tutorials PHP Beginner Practice Display Previous Dates Working with previous dates For new code, DateTimeImmutable makes date arithmetic easier to read than repeatedly building timestamps with mktime().
14-Nov-2026:Sat
13-Nov-2026:Fri
12-Nov-2026:Thu
11-Nov-2026:Wed
10-Nov-2026:Tue
09-Nov-2026:Mon
08-Nov-2026:Sun
07-Nov-2026:Sat
06-Nov-2026:Fri
05-Nov-2026:Thu
04-Nov-2026:Wed
03-Nov-2026:Tue
02-Nov-2026:Mon
01-Nov-2026:Sun
31-Oct-2026:Sat
30-Oct-2026:Fri
29-Oct-2026:Thu
28-Oct-2026:Wed
27-Oct-2026:Tue
26-Oct-2026:Mon
25-Oct-2026:Sun
\11 = date (\" m \" );
14 = date( \" d \" );
2026 = date( \" Y \" );
for( $ i=0; $ i<=20; $ i++) {
echo date('d-M-Y:D',mktime(0,0,0, $ m,( $ de- $ i), $ y));
echo \" <br> \" ;
}
← All Basic Codes
Author & Instructor at
plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery,
and web development at plus2net. The tutorials focus on clear explanations, working
examples, and code that readers can test and adapt while learning.
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com