<?php $today=getdate(); $i=mktime(0,0,0,$today['mon'],1,$today['year']); $arr = []; while(1){ $day=getdate($i); if ($day['mon']!=$today['mon']) break; if ($day['wday']==5){ $arr[]= "{$day['year']}-{$day['mon']}-{$day['mday']}"; } $i+=24*3600; } var_dump($arr);die; ?>