- print_r: documentation ( source)
<?php
$dateFrom = new DateTime('01-02-2013');
$dateTo = new DateTime("01-03-2013");
$dateTo->modify("+1 month");
$date = $dateFrom;
$result = array();
while ($dateFrom != $dateTo) {
$result[] = $date->format("m-Y");
$date->modify('+1 month');
}
print_r($result);