Write a PHP script to get the current month and previous three months

  • برمجة بي اتش بي

Write a PHP script to get the current month and previous three months.

الأجوبة

<?php
echo date("M - Y")."\n";
echo date("M - Y",strtotime("-1 Months"))."\n";
echo date("M - Y",strtotime("-2 Months"))."\n";
echo date("M - Y",strtotime("-3 Months"))."\n";
?>
Sample Output:
Jul - 2017                                                          
Jun - 2017                                                          
May - 2017                                                          
Apr - 2017
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...