>>> Programming >> PHP > How to find the first (1st) day in a week with PHP Date (This page has been seen 966 times)
How to find the first (1st) day in a week with PHP Date
Lets say you want to find the date of the first day in the current week. You
could do something like this
The Code:
The Code:
define('ONE_DAY', 60*60*24);
$WeekDayNumber = date('w');
$WeekBegin = date("m/d/y",time() - ($WeekDayNumber - 1)*ONE_DAY);
echo $WeekBegin;
Like (4)
Dislike (1)
Keywords for this article:
DATE || WEEK || TIME
Advertisement by Google
Comment:
Code Language:
Code:
Here you can paste a code example. It will then be processed by SyntaxHighlighter and formatted for easier readability.
Please remember to select the correct Code Language in the select above so the SyntaxHighlighter can highlight the code properly.
Code:
Please enter the code you see above
What is 5 + 6 =