Php

[php] 금주 월요일 날짜 구하기

마르스컴퍼니 2022. 11. 24. 20:04

금주 월요일 날짜 구하기 코드입니다.

$monday = date("Y-m-d", strtotime('last monday', strtotime('next week')));
echo $monday;

or

$monday =  strtotime('next Monday -1 week', strtotime('this sunday'));
echo $monday;

or

$monday = date('Y-m-d', strtotime("this week"));
echo $monday;
반응형