<?php
$row = 1;
$handle = fopen ("test.csv","r");
while ($data = fgetcsv ($handle, 1000, ",")) {
$num = count ($data);
print "<p> $num fields in line $row: <br>\n";
$row++;
for ($c=0; $c < $num; $c++) {
print $data[$c] . "<br>\n";
}
}
fclose ($handle);
?>
以上來自PHP手冊,但我沒有看到指定的編碼(如UTF8左右)如何在PHP中處理csv文件時指定編碼?
是的,當然,我會的,夥計:) – user198729 2010-01-12 11:08:21