- getdate: documentation ( source)
- mktime: documentation ( source)
- date: documentation ( source)
<?php
$currentMonth = date("n");
$currentYear = date("Y");
echo $currentMonth . "\n";
echo $currentYear;
$firstDayOfTheMonth = mktime(0, 0, 0, $month, 1, $year);
$d = getdate($firstDayOfTheMonth);
// Vasarnap helyett hetfo az elso nap a heten.
$dayOfTheWeekOfFirstDayOfTheMonth = (6 + $d["wday"]) % 7 + 1;
$totalDaysInCurrentMonth = date("t");
$kellenekUresNapokAHonapVegen = true;
echo $firstDayOfTheMonth . "\n";
echo $d . "\n";
echo $dayOfTheWeekOfFirstDayOfTheMonth . "\n";
echo $totalDaysInCurrentMonth . "\n";
?>