title: Passing a php array into javascript using JSON
body: <p>I have a multidimensional array, here:</p>
  
  <pre><code>$noticeDate = json_encode( $noticesDates );
  </code></pre>
  
  <p>and I want to pass the array into javascript:</p>
  
  <p>var unavailableDates[] = $noticeDate;</p>
  
  <p>Both variables are in the same php file so there is little point using $.getJSON, which basically looks for the variable in an external file. However, how do I pass the object into the javascript array in the same script.</p>
  
  <p>Cheers</p>