I have week number of current year and week day generated by date() like this.
$week_number = date('W');
$week_day = date('w');
I need to format this. How can I get starting date of this week? Or day of month with $week_number and $week_day?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Update:
Maybe this article helps you. It describes how to get the start and end date of a given week.
Where the format is
<year>W<week-number><daynumber>and Monday is1.Update 2:
Maybe another possibility is to use
strtotime()this way:You can combine this with
date()to get the date in the desired format.You can get the day of the month with
date('d')directly.date()documentation.