Is there a way to find out if a date falls within 7 days of the current date using PHP? If there is, would it also be possible to figure out how many days away that date is?
Share
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.
Could be refined a bit if you care about edge cases, whole days and daylight-savings/leap seconds issues, but this should hopefully give you the right idea. Of course the
Dateclass should be the preferred method to handle this, but it’s only available in PHP 5.3+.