Guest User

Untitled

a guest
Oct 21st, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. /*** Populate Dates ***/
  2. /*** $i as the count integer - $d as the total number of days ***/
  3. function populateDates()
  4.     {
  5.         $i = 0; $d = 14;
  6.         $start_date = strtotime(date("Y-m-d"));
  7.         $returnVar = "";
  8.         while($i <= $d){
  9.             $nextDate = date('Y-m-d', $start_date + ($i * 60 * 60 *24));
  10.             if (date('l', strtotime($nextDate)) != "Sunday" && date('l', strtotime($nextDate)) != "Saturday") {
  11.                 $addDate = date('d-m-Y', strtotime($nextDate));
  12.                 $returnVar .= $nextDate."|".$addDate.",";
  13.             } $i++;
  14.         } return $returnVar;
  15.     }
Add Comment
Please, Sign In to add comment