BBGaming Posted June 16, 2009 Share Posted June 16, 2009 for($i=0;$i<=9;$i++) { $file=fopen("action/" . $i . ".html","r"); $score[$i]=fgets($file); echo($score[$i] . "<br>"); $name[$i]=fgets($file); echo($name[$i] . "<br>"); fclose($file); } This code it only returning the first byte of each score (number). The file looks like this: 500000 Steve Johnson No matter what I change the number to, it only returns the first byte. But the weird thing is, it returns all of the name. I'm confused. I tried adding a byte count argument to the fgets(), but it still didn't help. Link to comment https://forums.phpfreaks.com/topic/162416-fgets-returning-1-byte/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.