|
|||||
|
|
#1 |
|
|
> Hello, > > I'm trying to read from a webpage using fread. The webpage contains a > list of data I need to parse into my administration. > > I get some data after sending a GET request. The problem is that this > data is incomplete. > > I used a packet sniffer to find out what my normal browser did and > found that the result is sent to me in multiple packets. > > The question: how can I receive the other packets? > > The code I use for receiving the data: > > Code: > > ////$data=""; $data = ''; > while (!feof($fp)) { > $data .= fread($fp, 4096); ^^^ > } works for me: Source code: <?php $handle = fopen("http://www.[pick-a-site].com/", "rb"); $contents = ''; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); echo $contents; // now put parsing stuff here... ?> |