title: Jquery ajax Pass post back data to php variable
body: <p>I have the below script to generate days in month with jq, I want to get the post back data pass to <code>for</code> loop as condition in php so that it could populate days in selection box accurately.</p>
  
  <p>Here is how change the days based on year and month </p>
  
  <pre><code>$('#mm').change(function () {
      var mm = $(this).val();
      var yy = $('#yy').val(); //get the year
      var dd = days_in_month(mm, yy);
  
      $.ajax({
          type: "POST",
          url: 'inc/callback/req_days_in_month.php',
          data: {
              days: dd,
          },
          success: function (data) {
              //something to do to pass data to php...?
          }
      });
  
      $('#dd').val(dd);
  });
  </code></pre>
  
  <p>I want <code>$i&lt;=31</code> replace with postback value from ajax,</p>
  
  <pre><code>&lt;select id="dd"&gt;
  for($i=1; $i&lt;=31; $i++){
      echo '&lt;option value="$i"&gt;$i&lt;/option&gt;';
  }
  &lt;/select&gt;
  </code></pre>
  
  <p><strong>req_days_in_month.php:</strong></p>
  
  <pre><code>&lt;?php
      $days = $_POST['days'];
      echo $days;
  ?&gt;
  </code></pre>
  
  <p>Can it possible be done?</p>