通过简单的编码将数据从 XLS 文件导入到 php
我有包含以下字段的 excel 文件
First Middle Last Email michael j jackson [email protected] mary j watson [email protected] jeff a bridges [email protected] nick h gill [email protected]
如果可能,请告诉我如何从同一个文件中的名称框(K8)获取数据
我想知道如何将此数据导入到 php 中(我可以上传 excel服务器上的文件)
通过使用简单的代码(不是任何预制脚本)
I have the excel file with the following fields
First Middle Last Email michael j jackson [email protected] mary j watson [email protected] jeff a bridges [email protected] nick h gill [email protected]
If possible please tell me how can i get the data from Name Box (K8) from the same file
I want to know how can import this data into the php (I m able to upload the excel file on the server)
by using simple code (not any premade script)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通常,对于电子表格等文件,最常用的是 CSV 导入。您可以将 Excel 文件导出为 csv。然后使用 PHP 导入它。
请参阅http://in.php.net/manual/en/function.fgetcsv。 php
但似乎您正在寻找读取 Excel 文件,您可能需要第三方库的帮助。您还可以查看以下文章:
http://www.ibm。 com/developerworks/opensource/library/os-phpexcel/
Typically for files like spreadsheets, CSV import is most used. You can export excel file to csv. and then import it using PHP.
See http://in.php.net/manual/en/function.fgetcsv.php
But it seems you are looking to read excel files, you may need help of third-party libraries for that. You also have a look at the following article:
http://www.ibm.com/developerworks/opensource/library/os-phpexcel/
您将无法在任何合理的时间范围内编写任何简单的代码来自己读取 BIFF 文件。由于不愿意使用能够读取 BIFF 文件的库,您唯一的快速解决方案是在上传之前将其转换为其他格式(例如 CSV)。
或者,如果您使用的是 Windows 服务器,您可以尝试使用 PHP 的 COM 扩展(只要您在服务器上安装了 MS Excel)
You won't be able to write any simple code to read a BIFF file yourself in any reasonable timeframe. Your only quick solution, given an unwillingness to use a library capable of reading BIFF files, is to convert it to a different format (such as CSV) before uploading it.
Alternatively, if you're on a windows server, you could try using PHP's COM extension (as long as you install MS Excel on your server)