title: json_encode works in php, but null in javascript
body: <p>I'm just learning php, and I am trying to parse some files I have, and then send the information to javascript. This is my php:</p>
  
  <pre><code>$datesArray = readFile();
  echo json_encode($datesArray);
  </code></pre>
  
  <p>This echoes:</p>
  
  <pre><code>["120102000000","120102000500","120102001000","120102001500","120102002000","120102002500","120102003000"]
  </code></pre>
  
  <p>Which is what I want. However, my javascript, which looks like this:</p>
  
  <pre><code>var dates = &lt;?php echo json_encode($datesArray); ?&gt;;
  console.log(dates);
  </code></pre>
  
  <p>keeps giving <code>dates</code> back as null, and I am not sure why. I have tried encoding the array as utf-8, and I have tried using <code>jQuery.parseJSON</code> which also did not work.</p>
  
  <p>Thanks--</p>