title: Javascript JSON.parse: unexpected character error
body: <p>I want to get a string from a php script, and parse it to a javascript array. but got the error : <strong>SyntaxError: JSON.parse: unexpected character</strong> for the line :JSON.parse(msg);</p>
  
  <p>I searched a lot , couldn't figure out where is my problem, please help check for me. Thanks.</p>
  
  <p>PHP side :</p>
  
  <pre><code>header("application/json; charset=utf-8");
  $sum = array(1,2,3,4,5);
  echo json_encode($sum);
  </code></pre>
  
  <p>Javascript :</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "save.php",
      contentType: "application/json; charset=utf-8",
      data: price,
      success: function (msg) {
          var i = 0;
          console.log(msg);
          var sum = new Array();
          sum = JSON.parse(msg);
          $('input.hj').each(function () {
              if (sum[i] &gt; 0) {
                  $(this).val(sum[i]);
              }
              i++;
          });
      }
  });
  </code></pre>