- explode: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$timestamp = strtotime('2019-01-18');
$date = date('Y-m-d', $timestamp);
$mthDays = date('t', $timestamp);
$dexpl = explode('-', $date);
$y = 0;
while ($y <= $mthDays) {
echo date('Y-m-d',strtotime($dexpl[0]."-".$dexpl[1]."-".$y)) . \PHP_EOL;
$y++;
}