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:
$page = file_get_contents( filter_var( $_POST[url], FILTER_SANITIZE_URL ) );
die( json_encode( $page ) );
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.
the question: is there a workaround to prevent only part of the file being transfered?
I need to grab files from other domains, so reading the contents of a file in jQuery is not really an option.
json_encodeis only limited by available memory.set_time_limit(0).