[英]why only 1000 records are read from a very large csv file using php?
我只是在學習使用 PHP 作為我工作中提出的要求,我試圖弄清楚為什么我的 CSV 文件中的 124938 條記錄中只有 1011 條記錄被讀取。 這是我正在使用的非常基本的代碼。
<?php
print "<table>\n";
$fp = fopen('STDPRICE_FULL.csv','r') or die("can't open file");
while($csv_line = fgetcsv($fp,1024)) {
print '<tr>';
for ($i = 0, $j = count($csv_line); $i < $j; $i++) {
print '<td>'.$csv_line[$i].'</td>';
}
print "</tr>\n";
}
print '</table>\n';
fclose($fp) or die("can't close file");
?>
當我打印 count($csv_line) 時,它只顯示 1011 條記錄。
現在我相信它可能與整數的大小有關,但我不確定。
此外,我搜索了增加整數大小的方法,但 PHP 似乎自己處理類型轉換。
誰能建議我可以做什么來讀取 CSV 文件中的所有行?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.