One could use string manipulation and basic math, but months with different number of days and leap years etc make this a futile approach.
It is better to use an instance of PHP DateTime and loop through that, which is a question already answered here:
$begin = new DateTime( '2010-05-01' );
$end = new DateTime( '2010-05-10' );
$interval = DateInterval::createFromDateString('1 day');
$period = new DatePeriod($begin, $interval, $end);
foreach ( $period as $dt )
echo $dt->format( "l Y-m-d H:i:s\n" );
The DateTime object has the added advantage of outputting various formats, useful when generating link names, URIs, SQL queries, etc.