Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 有效地计算文本文件的行数。(200mb+) 如何在块循环中使用 PHPExcel 库确定文件的结尾?
我似乎无法让它在 PHP 中工作
我正在尝试计算上传的 EXcel 文件中的行数
这是我所拥有的,但它总是将它乘以 2,我想删除第一行,因为它只是标题,请帮助:
$countthelines= count(file($file)) -1;
将您的 Excel 文件转换为 CSV 文件并尝试如下操作:
$countthelines = count(file($file, FILE_SKIP_EMPTY_LINES)) - 1;