I'm having some real problems with the lag produced by using fgets
to grab the server's response to some batch database calls I'm making.
I'm sending through a batch of say, 10,000 calls and I've tracked the lag down to fgets causing the hold up in the speed of my application as the response for each call needs to be grabbed.
I have found this thread http://bugs.php.net/bug.php?id=32806 which explains the problem quite well, but he's reading a file, not a server response so fread
could be a bit tricky as I could get part of the next line, and extra stuff which I don't want.
So my question is, what is the best/fastest way to read the response from the server as an alternative to fgets?