How do I read all the data until the last transmission of a connection, without closing it and without causing an endless loop, while leaving the connection open?
I've tried this:
while (!feof($fs)) {
$a .= fgets($fs, 1024);
}
but it just loops endlessly.
I'm trying to use this for remote SMTP with optional output (for debugging purposes), but it's getting to be a pain in the ass.