title: Calculating remaining days in a month
body: <p>So suppose I have a user that is capable of choosing a certain date in the month. If he would, let's say, choose the 16th of October 2014, I want to display the remaining days of the month as a calendar.</p>
  
  <pre><code>&lt;?php
  error_reporting(0);
  
  $data  = $_POST['input'];
  $days = array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');
  
  $m = date('m'); $y = date('y');
  $d = cal_days_in_month(CAL_GREGORIAN,$m,$y);
  
  for ($i=1;$i&lt;;$i++){ 
      echo $i + 1; 
  }
  </code></pre>
  
  <p>Code is pretty messy as of now. I just have no way to go round this, that is why I asked.</p>