How you define week is fairly simple. It is a seven day period beginning on a Sunday. Therefore the first "week" of this month was not a complete week. If you want to define week as any number of days, so long as it starts the month, then the definition changes. For example, in June (next month) June 1st happens on a Saturday, so the first Sunday in June is June 2. Would you still want the singleton June 1 to count as a whole week?

Week number has an ISO-8601 standard definition that is relative to year, but not to month. The term "month" is ambiguous since different months have different numbers of days. When you wrap the term "week" with the term "month" you risk introducing this ambiguity into an otherwise standard definition. Hence my question to clarify how the author wants to define the week number, relative to the month.

PHP strtotime() and date() work well together to get an answer. All we need, to provide proven code, is the clarification of the author's intent.

Good question! It would show the effect that would arise if incorrect information was accidentally input to the algorithm. I think the week number of the month is not a standardized thing, so any of our answers might be OK for the author of the question. We can't know because the question is incomplete in its description of the problem.

In my experience, it's almost always better practice to use the PHP built-in functions for DATETIME calculations. I say that mostly because I am lazy and already know how to do most of what I need with strtotime() and date() or the related OOP built-ins.

Yes, I understand, and I think your answer makes sense. I've been trying to get rgb192 to take some interest in the DATETIME article.

Looking forward to June (which is almost here) the first week has only one day on a conventional western calendar because June starts on Saturday. Do you count that one day as a week? Or do you count the first seven days as the first week, no matter which weekday begins the month? The ISO standard about the week number of the year has some interesting anomalies, to wit, you can have week number 53 in some years because the standard starts all weeks consistently, on Monday. See date('W') for the explanation. It's not clear to me whether rgb192 wants to comply with the standard for when weeks start. USA calendars do not, but that's a separate matter.

Here is the demo about the week number when applied to a year. It may or may not make any difference to this question but it's interesting to see how PHP handles some of these things.http://www.laprbass.com/RAY_temp_julianh.php

Well, the only month that will have exactly 28 days will be February, and this will be true 3/4 of the time. The other months will have more than 28 days. You may choose to define the last few 28+ days as "week 5."

how can I tell input month

You can use the timestamp of any day in the month and find date('m') or similar.

I don't understand the question - the only month you can tell is February - the rest is ambiguous but still don't know what you mean by how can you tell what the input month is - surely you will provide this?

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption. Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…

The viewer will learn how to create a basic form using some HTML5 and PHP for later processing.
Set up your basic HTML file. Open your form tag and set the method and action attributes.:
(CODE)
Set up your first few inputs one for the name and …