thedeplorableword by Tom Martin
strtotime is amazing

Work out the date of the fourth Saturday in each month, if that date has passed, tell me when the next one is. 

if (date('j') <= date('j',strtotime('Fourth Saturday '.date('F o')))) {
	return "The next market is on the ".date('dS F',strtotime('Fourth Saturday '.date('F',strtotime('Next month')).' '.date('o'))); 
	} else { 
	return "The next market is on the ".date('dS F',strtotime('Fourth Saturday '.date('F o'))); 
	}
}

  1. browneyes reblogged this from deplorableword
  2. deplorableword posted this