What is the best way to determine the first Monday of a specific date in PHP?

To determine the first Monday of a specific date in PHP, you can use the `strtotime` function to find the timestamp of the given date and then calculate the offset to the next Monday. By subtracting the day of the week from the timestamp and adding 1 if the day is after Monday, you can find the timestamp of the first Monday of that week.

$date = "2022-01-15"; // Specific date
$timestamp = strtotime($date);
$firstMonday = strtotime('last Monday', $timestamp);

if (date('N', $timestamp) > 1) {
    $firstMonday = strtotime('+1 week', $firstMonday);
}

echo date('Y-m-d', $firstMonday); // Output: 2022-01-10