title: PHP array() to javascript array()
body: <p>I'm trying to convert a PHP array to a javascript array for jQuery's datetimepicker to disable some dates. But I can't seem to find the right answer on the internet. I'm using Zend Framework for my project.</p>
  
  
  
  <pre><code>&lt;?php 
              $ConvertDateBack = Zend_Controller_Action_HelperBroker::getStaticHelper('ConvertDate');
              $disabledDaysRange = array();
              foreach($this-&gt;reservedDates as $dates) {
                   $date = $ConvertDateBack-&gt;ConvertDateBack($dates-&gt;reservation_date);
                   $disabledDaysRange[] = $date;
              }
  ?&gt;
  &lt;script&gt;
  var disabledDaysRange = $disabledDaysRange ???? Please Help;
  $(function() {
      function disableRangeOfDays(d) {
          for(var i = 0; i &lt; disabledDaysRange.length; i++) {
              if($.isArray(disabledDaysRange[i])) {
                  for(var j = 0; j &lt; disabledDaysRange[i].length; j++) {
                      var r = disabledDaysRange[i][j].split(" to ");
                      r[0] = r[0].split("-");
                      r[1] = r[1].split("-");
                      if(new Date(r[0][2], (r[0][0]-1), r[0][1]) &lt;= d &amp;&amp; d &lt;= new Date(r[1][2], (r[1][0]-1), r[1][1])) {
                          return [false];
                      }
                  }
              }else{
                  if(((d.getMonth()+1) + '-' + d.getDate() + '-' + d.getFullYear()) == disabledDaysRange[i]) {
                      return [false];
                  }
              }
          }
          return [true];
      }
      $('#date').datepicker({
          dateFormat: 'dd/mm/yy',
          beforeShowDay: disableRangeOfDays
          });
  });
  &lt;/script&gt;
  </code></pre>