[PHP] php 由 pipe (stdin) 讀進檔案 再做處理, 類似 C 的 pipe line 方法 2023/08/192019/12/27 by Monster $cnt = 0; $fp = fopen('php://stdin','r'); while ($line = stream_get_line($fp, 65535, "\n")) { echo "LINE #" . (++$cnt) . ": " . $line . "\n"; }