PHP fgets(),fgets函數 從文件指針中讀取一行 - PHP100
For large files, consider using stream_get_line rather than fgets - it can make a significant difference. $ time yes "This is a test line" | head -1000000 | php -r '$fp=fopen("php://stdin","r"); while($line=stream_get_line($fp,65535," ")) { 1; } fclose($f...