<?php
$d = new DateTime('2015-12-31');
$d->modify('first day of last month');
echo $d->format('Y-m-28');
?>
PD9waHAKICAgICRkID0gbmV3IERhdGVUaW1lKCcyMDE1LTEyLTMxJyk7CiAgICAkZC0+bW9kaWZ5KCdmaXJzdCBkYXkgb2YgbGFzdCBtb250aCcpOwogICAgZWNobyAkZC0+Zm9ybWF0KCdZLW0tMjgnKTsKPz4=