Home >Backend Development >PHP Tutorial >phpexcel 导入日期时间的问题

phpexcel 导入日期时间的问题

WBOY
WBOYOriginal
2016-06-06 20:35:292381browse

<code>import("Org.Util.PHPExcel");
$PHPExcel=new \PHPExcel();
vendor('PHPExcel.PHPExcel.IOFactory');
dump($data);
echo PHPExcel_Shared_Date::ExcelToPHP($data['2'][A]);
</code>

为什么使用了还是
Class 'Home\Controller\PHPExcel_Shared_Date' not found

回复内容:

<code>import("Org.Util.PHPExcel");
$PHPExcel=new \PHPExcel();
vendor('PHPExcel.PHPExcel.IOFactory');
dump($data);
echo PHPExcel_Shared_Date::ExcelToPHP($data['2'][A]);
</code>

为什么使用了还是
Class 'Home\Controller\PHPExcel_Shared_Date' not found

看你的错误:Class 'Home\Controller\PHPExcel_Shared_Date' not found

此命名空间Home\Controller\下有没有这个类呢?

你上面有用 \PHPExcel();那么这个类PHPExcel_Shared_Date你也应该加上相应的命名空间来作限定;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn