<?php $file = './test.txt'; $fileCont = file_get_contents($file); echo substr_count($fileCont, "\n")."行";