Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

1-4 week type

Posted on 2013-05-24
2
Medium Priority
?
281 Views
Last Modified: 2013-05-28
PHP
4 different week(date) types
this week is the 21st week of the year: this could be week_type 1
next week: week_type: 2
following week: week_type: 3
final week: week_type:4
week after: week_type:1
0
Comment
Question by:rgb192
2 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 39195860
Information about week number is outlined in this article.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html

In the PHP date('W') function you can find the ISO week number.  You want to use the ISO number because it is a standard.  The PHP modulus operator can be used to compute the remainder.  The remainder will be zero through three.  If you want to renumber this one through four, add one to the modulus.  See the % operator.
0
 

Author Closing Comment

by:rgb192
ID: 39203081
thanks
0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question