I have seen this. I'm not sure what causes it, but I have a good work around:
$myCompleteFile = implode("", file("http://otherserver.com/file.php?var=2"));
This will read the entire file into $myCompleteFile which is better than fopen because you can't really read through a remotely fopene'd file the same way you can locally.