title: json_encode giving recursion error
body: <pre><code>Warning:  json_encode(): recursion detected in [Directory] 
  </code></pre>
  
  <p>What is this error, I can't seem to solve the issue. It's generating a BIG BIG log per error 500 faced. 133,000,000 bytes in size. It's spamming the log till memory max out.</p>
  
  <pre><code>&lt;?php
  include('simple_html_dom.php');
  
  if(isset($_REQUEST['type']) &amp;&amp; $_REQUEST['type'] = "getmoredetails"){ 
  retrievemore($_REQUEST['htmlsource']);
  }
  
  function retrievemore($htmlcode){
  $retrievetitle = retrievechTitle($htmlcode);
  $retrievermb = retrievechRMB($htmlcode);
  echo json_encode(array("error"=&gt;0,"rmb"=&gt;$retrievermb,"title"=&gt;$retrievetitle));
  }
  function retrievechTitle($htmlcode){
  $html = str_get_html($htmlcode);
  $title = $html-&gt;find('div[class=tb-detail-hd]h3');
  return $title[0];
  }
  function retrievechRMB($htmlcode){
  $html = str_get_html($htmlcode);
  $rmb = $html-&gt;find('[class=tb-rmb-num]');
  return $rmb[0];
  }
  
  ?&gt;
  </code></pre>
  
  <p>I'm trying to extract data from a HTML file, the other extraction works fine, except for the above, giving lots of issue. I even separated this set of code specifically to one PHP file for processing and same issue. </p>
  
  <p>Any idea? I use jQuery Ajax with multiple functions at home page with <code>$.ajax({</code><br>
  I'm new to Ajax, it's alright to have multiple Ajax in one page right?</p>