-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) –
也许是一个时区问题;但没有更多信息,我们所能做的只是猜测 –