title: getting remaining days excluding weekends
body: <p>i just want to know how to get the remaining days excluding the weekends. i tried subtracting two dates but i cant seem to find any solutions on removing weekends. well this is my code:</p>
  
  <pre><code>            $date_registered = date('Y-m-d');
              $date_planned = $_POST['start_date'];
              $dueDate = $date_registered;
              $numDays = 3;
              $counter = 1;
              while ($counter &lt;= $numDays) {
  
                 $dueDate = date("Y-m-d", strtotime(date("Y-m-d", strtotime($dueDate)) . " +1 day"));
                 $dayOfTheWeek = date("l",strtotime($dueDate));
  
              if ($dayOfTheWeek == "Saturday" || $dayOfTheWeek == "Sunday") {
                     continue;
                 }else {
                    $counter++;
                 }
  
              }
              echo $date_registered.'&lt;br&gt;';
              echo $date_planned.'&lt;br&gt;';
              //echo $dueDate;
              $remaining_days = strtotime($date_registered) - strtotime($date_planned);
              echo $remaining_days/86400;
  </code></pre>
  
  <p>i dont have any idea how to exclude the weekends .i hope you could help me. </p>