-1
我正在使用excel/reader.php來讀取CSV文件並獲取數據。爲什麼php excel閱讀器從CSV中輸出多一天
在CSV日期字段有值:20/10/2014
Customer Name Date
Lorem Spem 20/10/14
,當我讀了CSV使用PHP後打印:
$file_name = $_FILES['file']['tmp_name'];
$library_path = getcwd().'/application/libraries/excel/reader.php';
require_once $library_path;
$excel = new Spreadsheet_Excel_Reader();
$excel->setOutputEncoding('CP1251');
$status = $excel->read($file_name);
$totalSheets = count($excel->sheets);
for($sheetCount = 0 ; $sheetCount < $totalSheets ; $sheetCount++)
{
$excel_data = $excel->sheets[$sheetCount]['cells'];
$totalRows = $excel->sheets[$sheetCount]['numRows'];
print_r($excel_data);
}
它給出結果:21 /二千零十四分之十
Array ([1] => Lorem Spem [2] => 21/10/2014)
我不知道爲什麼這一天,有一個CSV 添加到日期請需要幫助
你總是問問題而不提供任何有用的信息嗎? – Naruto
用戶需要查看您的'php'代碼添加您的代碼,如[this](http://stackoverflow.com/q/27352322/3836908) –
也許是一個時區問題;但沒有更多信息,我們所能做的只是猜測 –