So going from the comments, I can't really work out how you came to the code you've provided. To be honest, I would recommend looking through some PHP documentation and tutorials before continuing as you seem to be missing some knowledge of basics such as arrays and loops.
That being said, again going by your comments, the following should produce what you're after:
<?php
$iterator = 24;
$array = array();
foreach(range(2015, 2016) as $year) {
foreach(range(1, 12) as $month) {
$dateObj = DateTime::createFromFormat('!m', $month);
$monthName = $dateObj->format('F');
$array[$year][$monthName] = $iterator++;
}
}
echo '<pre>';
print_r($array);
echo '</pre>';
This should be easily editable to your needs.