Wednesday, 30 July 2014

Ultimo

Can't seem to find this but I've been using it a lot lately:
<?php
$ultimo = array(
    "description" => "Year, month, first and last days for last month",
    "year" => date("Y", strtotime("-1 months")),
    "month" => date("m", strtotime("-1 months")),
    "first" => date("d", mktime(0, 0, 0, date("m")-1, 1, date("Y"))),
    "last" => date("d", mktime(0, 0, 0, date("m"), 0, date("Y")))
);
?>