- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
PHP导入导出Excel方法.doc
1:类Excel格式,这个其实不是传统意义上的Excel文件,只是因为Excel的兼容能力强,能够正确打开而已。修改这种文件后再保存,通常会提示你是否要转换成Excel文件。优点:简单。缺点:难以生成格式,如果用来导入需要自己分别编写相应的程序。2:Excel格式,与类Excel相对应,这种方法生成的文件更接近于真正的Excel格式。
如果导出中文时出现乱码,可以尝试将字符串转换成gb2312,例如下面就把$yourStr从utf-8转换成了gb2312:$yourStr = mb_convert_encoding(”gb2312″, “UTF-8″, $yourStr);
下面详细列举几种方法。一、PHP导出Excel
PHP代码?php /** * PHPExcel * * Copyright (C) 2006 - 2007 PHPExcel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel * @package PHPExcel * @copyright Copyright (c) 2006 - 2007 PHPExcel ) * @license LGPL * @version 1.5.0, 2007-10-23 */ /** Error reporting */ error_reporting(E_ALL); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . ‘../Classes/’); /** PHPExcel */ include ‘PHPExcel.php’; /** PHPExcel_Writer_Excel2007 */ include ‘PHPExcel/Writer/Excel2007.php’; // Create new PHPExcel object echo date(’H:i:s’) . ” Create new PHPExcel object\n”; $objPHPExcel = new PHPExcel(); // Set properties echo date(’H:i:s’) . ” Set properties\n”; $objPHPExcel-getProperties()-setCreator(”Maarten Balliauw”); $objPHPExcel-getProperties()-setLastModifiedBy(”Maarten Balliauw”); $objPHPExcel-getProperties()-setTitle(”Office 20
您可能关注的文档
- office文档恢复基础之office文件格式1.doc
- Old Man Myths and Realities.doc
- Olympus ZD 60mm f2.8微距镜头和FL-600R无线闪灯系统测评.doc
- On the company.doc
- One-year prognosis in sick-listed low back pain patients with and without.doc
- Opening Remarks to the China-Australia Media Forum.doc
- opexstyle3.doc
- Outlook的命令行参数.doc
- P&G笔试测试题.doc
- P2X3受体论文:黄芩苷对颈部交感神经节细胞P2X_(2-3)受体介导心肌缺血引发交感兴奋反射的作用研究.doc
- Physicochemical properties of lactoferrin stabilized oil-in-water emulsions Effects of pH, salt and.doc
- ping命令的使用.doc
- Pipe before installation site should have condition is.doc
- PIX 的基本配置命令及配置实例.doc
- pkpm快捷键.doc
- Planning Techniques.doc
- Planthormone.doc
- PMP试题435道.doc
- polyester wastewater.doc
- PowerPoint 2003大纲.doc
文档评论(0)