Given a date I want to find the next date which is a particular day of week. Eg.
Today (8/24/2012)
Find next Sunday(0) returns 8/26/2012
Find next Friday(5) returns 8/24/2012 (Today's a Friday)
I can find the day of week for a particular day using:
date("w", timeStamp)
You can use
strtotime():Calling
strtotime("next Sunday");will get you the Unix timestamp for next Sunday.You can give a second parameter to it, which is a Unix timestamp, and the “next Sunday” will be relative to that date.