Codice PHP:
<?php
// aggiungi 1 al mese di cui vuoi sapere i giorni. ad esempio per marzo 2007 metti 3+1.
$fine_mese date('Y-m-d'mktime(0,0,0102007)  );
$domeniche = array(); //inizializzi l'array
for($i strtotime('2007-03-01'); $i<=strtotime($fine_mese); $i strtotime('+1 day',$i)) {
  if (
date('w',$i) == 0// quando il giorno è domenica 
  
$domeniche[] = date('d-m-Y',$i); // lo aggiungi all'array
 
}
echo 
'<pre>';
print_r($domeniche);   //lo stampi
?>