title: json_decode outputs nothing (trying to get json_encode'd data from external php file)
body: <p>In <code>_check_existing_transaction_partners.php</code></p>
  
  <pre><code>echo '&lt;pre&gt;';
  print_r($ajax_existing_company_error);
  echo '&lt;/pre&gt;';
  </code></pre>
  
  <p>(<em>using <code>json_encode</code> I comment this. Now show only as example</em>)</p>
  
  <p>outputs this </p>
  
  <pre><code>Array
  (
      [0] =&gt; 1
      [1] =&gt; 2
  )
  </code></pre>
  
  <p>and <code>echo json_encode($ajax_existing_company_error);</code></p>
  
  <p>outputs this <code>["1","2"]</code></p>
  
  <p>Jquery code to send data to external file and receive back</p>
  
  <pre><code>var checkbox_to_update = $("#checkbox_to_update").val();
  $.post("_check_existing_transaction_partners.php", { 'checkbox_to_update': checkbox_to_update }, function(data, success) {
  alert(data);
  }, "json");
  </code></pre>
  
  <p>With <code>alert(data);</code> get popup with <code>1,2</code>. So far all OK.</p>
  
  <hr>
  
  <p>Trying instead of popup get some other format (to process latter)</p>
  
  <p>Tried <code>$('#json_load').val(data);</code> and <code>&lt;div id="json_load"&gt;&lt;/div&gt;</code>. See nothing</p>
  
  <p>Then tried <code>$myArray = json_decode($ajax_existing_company_error);</code> and <code>&lt;?php print_r($myArray); ?&gt;</code> Also see nothing.</p>
  
  <p>Please advice how to get <code>$myArray = json_decode($ajax_existing_company_error);</code> or <code>$('#json_load').val(data);</code></p>
  
  <p><strong>Update</strong></p>
  
  <p>Regarding <code>json_decode</code> In <code>_check_existing_transaction_partners.php</code> is <code>echo json_encode($ajax_existing_company_error);</code></p>
  
  <p>Then <code>jquery</code> </p>
  
  <pre><code>var checkbox_to_update = $("#checkbox_to_update").val();
  $.post("_check_existing_transaction_partners.php", { 'checkbox_to_update': checkbox_to_update }, function(data, success) {
  &lt;?php print_r(json_decode($ajax_existing_company_error)); ?&gt;
  }, "json");
  </code></pre>
  
  <p>With View source see nothing related with <code>json_decode</code></p>
  
  <p>Then placed <code>&lt;?php print_r(json_decode($ajax_existing_company_error)); ?&gt;</code> just before closing <code>&lt;/body&gt;</code>. Also see nothing</p>