I am creating a PDF sales report and I need my PDF to show the report from the previous month.
I am already using this:
<?php date("F Y", strtotime("-1 months")); ?>
and it produces the result I need:
However, since some months have 31 days, I’ve heard this code will not work since
strtotime(); does not work for months with 31 days.
Is there an alternative way to code this properly or am I misunderstanding something?