PHP: Latest day of a month using PHP 5

Published at Wed, 20 May 2009 00:00:00 UTC by soywiz

```php // Previous month: date_create(date('Ym01'))->modify('-1 day') // This month: date_create(date('Ym01'))->modify('+1 month -1 day') // From a specific month via timestamp: date_create(date('Ym01', $timestamp))->modify('+1 month -1 day') ```
```php // Mes anterior: date_create(date('Ym01'))->modify('-1 day') // Este mes: date_create(date('Ym01'))->modify('+1 month -1 day') // Un mes concreto mediante timestamp: date_create(date('Ym01', $timestamp))->modify('+1 month -1 day') ```