What are the common practices for defining and working with month-weeks in PHP, considering ISO/DIN norms for calendar weeks?

To define and work with month-weeks in PHP while adhering to ISO/DIN norms for calendar weeks, you can use the `DateTime` class to calculate the week number within a month. This can be achieved by getting the week number of the first day of the month and then calculating the week number of a specific date relative to that.

function getMonthWeek($date){
    $firstDayOfMonth = new DateTime($date->format('Y-m-01'));
    $weekNumberFirstDay = (int)$firstDayOfMonth->format('W');
    
    $weekNumber = (int)$date->format('W');
    $monthWeek = $weekNumber - $weekNumberFirstDay + 1;
    
    return $monthWeek;
}

$date = new DateTime('2022-03-15');
echo getMonthWeek($date); // Output: 3