title: PHP json_encode size limit?
body: <p>I'm using a PHP proxy to get the contents of a file. I want to search through that file using the powerfull jQuery options, without having to write all kinds of queries in PHP. Here is my PHP code: </p>
  
  <pre><code>$page = file_get_contents( filter_var( $_POST[url], FILTER_SANITIZE_URL ) );
  die( json_encode( $page ) );
  </code></pre>
  
  <p>If the page loaded gets too big PHP will read the entire document, but json_encoding it will only give the first part of the file, not the entire file. I can't find anything about a size limit on json passed data, but apparently there is one.</p>
  
  <p>the question: is there a workaround to prevent only part of the file being transfered? </p>
  
  <p>I need to grab files from other domains, so reading the contents of a file in jQuery is not really an option. </p>