fijate si te sirve esto:
Código PHP:
<?php
$fechas = array('01-01-2012','02-01-2012','20-01-2012','05-02-2012','21-02-2012','06-03-2012','15-03-2012','26-03-2012');
$i=0;
foreach($fechas as $key => $val)
{
$x = explode('-',$fechas[$key]);
$mes = $x[1];
switch($mes)
{
case 01:
$c1++;
$fecha[$i]['fecha'] = $fechas[$key];
$fecha[$i]['mes'] = $mes;
$fecha[$i]['id'] = $c1;
break;
case 02:
$c2++;
$fecha[$i]['fecha'] = $fechas[$key];
$fecha[$i]['mes'] = $mes;
$fecha[$i]['id'] = $c2;
break;
case 03:
$c3++;
$fecha[$i]['fecha'] = $fechas[$key];
$fecha[$i]['mes'] = $mes;
$fecha[$i]['id'] = $c3;
break;
}
$i++;
}
/*
*
Esto quedaria:
Array
(
[0] => Array
(
[fecha] => 01-01-2012
[mes] => 01
[id] => 1
)
[1] => Array
(
[fecha] => 02-01-2012
[mes] => 01
[id] => 2
)
[2] => Array
(
[fecha] => 20-01-2012
[mes] => 01
[id] => 3
)
[3] => Array
(
[fecha] => 05-02-2012
[mes] => 02
[id] => 1
)
[4] => Array
(
[fecha] => 21-02-2012
[mes] => 02
[id] => 2
)
[5] => Array
(
[fecha] => 06-03-2012
[mes] => 03
[id] => 1
)
[6] => Array
(
[fecha] => 15-03-2012
[mes] => 03
[id] => 2
)
[7] => Array
(
[fecha] => 26-03-2012
[mes] => 03
[id] => 3
)
)
*/
?>