It’s simple to get last month date
echo date("Y-n-j", strtotime("first day of previous month"));
echo date("Y-n-j", strtotime("last day of previous month"));
at November 3 returns
2014-10-1
2014-10-31
More Related Contents:
- PHP store hours, closed dates [closed]
- Getting error in coding PHP [closed]
- PHP 01/01/1970 Issues with Date Fields
- Convert one date format into another in PHP
- PHP How to find the time elapsed since a date time? [duplicate]
- Convert seconds into days, hours, minutes and seconds
- Converting string to Date and DateTime
- I have 2 dates in PHP, how can I run a foreach loop to go through all of those days?
- PHP get number of week for month
- Getting date format m-d-Y H:i:s.u from milliseconds
- Convert number to month name in PHP
- The first day of the current month in php using date_modify as DateTime object
- PHP: Adding months to a date, while not exceeding the last day of the month
- Calculate age based on date of birth
- php date validation
- How to find the date of a day of the week from a date using PHP?
- get next and previous day with PHP
- PHP order array by date? [duplicate]
- how to convert php date formats to GMT and vice versa?
- change the date format in laravel view page [duplicate]
- Calculate the number of months between two dates in PHP?
- How to display a date as iso 8601 format with PHP
- Format date from database?
- date() method, “A non well formed numeric value encountered” does not want to format a date passed in $_POST
- MySQL, how to insert null dates
- Converting to date in PHP from yyyymmdd format
- Subtracting a certain number of hours, days, months or years from date
- How can I work with dates before 1900 in PHP?
- How do I convert an ISO8601 date to another format in PHP?
- Determine If Business Is Open/Closed Based On Business Hours