<?php
$year = 2019;
$date = new DateTime($year . '-01-01 00:00:00');
$dateInterval = new DateInterval('P1D');
$saturdays = [];
do {
if ($date->format('N') == 6) {
$saturdays[] = $date->format('d/m/Y');
}
$date->add($dateInterval);
} while ($date->format('Y') == $year);
var_dump($saturdays);
function get_date_day($date_my,$number_day) {
$result='';
for($i = 1; $i <= date("t",strtotime($date_my.'-01')); $i++) {
$weekend = date("N",strtotime($date_my.'-'.$i));
if($weekend == $number_day) {
$result.="'".$date_my.'-'.$i.',';
}
}
$result= substr($result, 0, strlen($result) - 1);
return $result;
}