<span style="font-family:Verdana,Helvetica,Arial,sans-serif; font-size:14px; line-height:24px; text-align:left">之前看到过好多关于PHP导出Excel的文章,自己也通过不少方法实现过,例如,echo一个Table,然后将header修改为Excel即可。</span>
<br style="word-wrap:break-word; line-height:24px; font-family:Verdana,Helvetica,Arial,sans-serif; font-size:14px; text-align:left">
<br style="word-wrap:break-word; line-height:24px; font-family:Verdana,Helvetica,Arial,sans-serif; font-size:14px; text-align:left">
<span style="font-family:Verdana,Helvetica,Arial,sans-serif; font-size:14px; line-height:24px; text-align:left">其实在众多方法中感觉Pear中的Spreadsheet_Excel_Writer很是好用。</span>
<br style="word-wrap:break-word; line-height:24px; font-family:Verdana,Helvetica,Arial,sans-serif; font-size:14px; text-align:left">
<br style="word-wrap:break-word; line-height:24px; font-family:Verdana,Helvetica,Arial,sans-serif; font-size:14px; text-align:left">
<span style="font-family:Verdana,Helvetica,Arial,sans-serif; font-size:14px; line-height:24px; text-align:left">关于Spreadsheet_Excel_Writer的</span>
<span class="t_tag" style="word-wrap:break-word; line-height:24px; border-bottom-width:1px; border-bottom-style:solid; border-bottom-color:rgb(255,0,0); white-space:nowrap; font-family:Verdana,Helvetica,Arial,sans-serif; font-size:14px; text-align:left">安装</span>
<span style="font-family:Verdana,Helvetica,Arial,sans-serif; font-size:14px; line-height:24px; text-align:left">本文不予介绍,可通过Google找到答案:) 也可参考:</span>
<a href="http://pear.php.net/package/Spreadsheet_Excel_Writer/download" rel="noopener noreferrer" style="word-wrap:break-word; text-decoration:none; color:rgb(0,102,204); line-height:24px; font-family:Verdana,Helvetica,Arial,sans-serif; font-size:14px; text-align:left" target="_blank">http://pear.<span class="t_tag" style="word-wrap:break-word; border-bottom-width:1px; border-bottom-style:solid; border-bottom-color:rgb(255,0,0); white-space:nowrap">php</span>.net/package/Spreadsheet_Excel_Writer/download</a>
<div class="blockcode" style="word-wrap:break-word; line-height:24px; margin:10px 0px; padding:10px 0px 5px 10px; width:700px; border:1px solid rgb(204,204,204); background-color:rgb(247,247,247); overflow:hidden; font-family:Verdana,Helvetica,Arial,sans-serif; font-size:14px; text-align:left">
<div id="code37936_-1" style="word-wrap:break-word">
<ol style="word-wrap:break-word; margin:0px 0px 0px 10px; padding:0px"><li style="word-wrap:break-word; margin:0px 0px 0px 2em; padding:0px 0px 0px 10px; line-height:1.8em; list-style-type:decimal-leading-zero; font-family:Monaco,Consolas,'Lucida Console','Courier New',serif; font-size:12px"> <?php<br style="word-wrap:break-word"> </li><li style="word-wrap:break-word; margin:0px 0px 0px 2em; padding:0px 0px 0px 10px; line-height:1.8em; list-style-type:decimal-leading-zero; font-family:Monaco,Consolas,'Lucida Console','Courier New',serif; font-size:12px"> //调用Writer.php<br style="word-wrap:break-word"> </li><li style="word-wrap:break-word; margin:0px 0px 0px 2em; padding:0px 0px 0px 10px; line-height:1.8em; list-style-type:decimal-leading-zero; font-family:Monaco,Consolas,'Lucida Console','Courier New',serif; font-size:12px"> require_once 'Spreadsheet/Excel/Writer.php';<br style="word-wrap:break-word"> </li><li style="word-wrap:break-word; margin:0px 0px 0px 2em; padding:0px 0px 0px 10px; line-height:1.8em; list-style-type:decimal-leading-zero; font-family:Monaco,Consolas,'Lucida Console','Courier New',serif; font-size:12px"> //创建Workbook<br style="word-wrap:break-word"> </li><li style="word-wrap:break-word; margin:0px 0px 0px 2em; padding:0px 0px 0px 10px; line-height:1.8em; list-style-type:decimal-leading-zero; font-family:Monaco,Consolas,'Lucida Console','Courier New',serif; font-size:12px"> $workbook = new Spreadsheet_Excel_Writer();<br style="word-wrap:break-word"> </li><li style="word-wrap:break-word; margin:0px 0px 0px 2em; padding:0px 0px 0px 10px; line-height:1.8em; list-style-type:decimal-leading-zero; font-family:Monaco,Consolas,'Lucida Console','Courier New',serif; font-size:12px"> //定义导出Excel文件名<br style="word-wrap:break-word"> </li><li style="word-wrap:break-word; margin:0px 0px 0px 2em; padding:0px 0px 0px 10px; line-height:1.8em; list-style-type:decimal-leading-zero; font-family:Monaco,Consolas,'Lucida Console','Courier New',serif; font-size:12px"> $workbook->send('test.xls');<br style="word-wrap:break-word"> </li><li style="word-wrap:break-word; margin:0px 0px 0px 2em; padding:0px 0px 0px 10px; line-height:1.8em; list-style-type:decimal-leading-zero; font-family:Monaco,Consolas,'Lucida Console','Courier New',serif; font-size:12px"> //创建Worksheet<br style="word-wrap:break-word"> </li><li style="word-wrap:break-word; margin:0px 0px 0px 2em; padding:0px 0px 0px 10px; line-height:1.8em; list-style-type:decimal-leading-zero; font-family:Monaco,Consolas,'Lucida Console','Courier New',serif; font-size:12px"> $worksheet =& $workbook->addWorksheet('My first worksheet');<br style="word-wrap:break-word"> </li><li style="word-wrap:break-word; margin:0px 0px 0px 2em; padding:0px 0px 0px 10px; line-height:1.8em; list-style-type:decimal-leading-zero; font-family:Monaco |
|