title: Codeigniter PHP Ajax returns array brackets only
body: <p>I have a a function that returns an array that is structured like this </p>
  
  <pre><code>[[{"title":"Mr","first_name":"James","last_name":"Loo","date_of_birth":36356,"email":"test@test.com","phone_number":1234567890,"company":"CompanyOne"},{"title":"Mr","first_name":"Jonah","last_name":"Lee","date_of_birth":42629,"email":"test@test2.com","phone_number":1234567890,"company":"CompanyTwo"}],
  []]
  </code></pre>
  
  <p>Within the array are 2 arrays. The first one is a "entry not inserted" array and the second one is a "entry inserted" array.</p>
  
  <p>However when I execute the code through this function</p>
  
  <pre><code>$result = $this-&gt;curl-&gt;execute();
  $result_errors = array();
  for($j=0;$j&lt;sizeof($result);$j++){
     $result_errors = $result[0];
  }
  if(sizeof($result_errors)&gt;0){
     echo json_encode($result_errors);
  }
  </code></pre>
  
  <p>The result I get in the console is "[" only. </p>
  
  <p>Am I missing something? I have read that I had to echo and json encode arrays but it doesn't seem to be coming out.</p>