我有網格,獲取數據從數據庫這樣的: -轉換數據從數據庫中脫穎而出
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="gwlines">
<tbody><tr>
<th width="15">#</th>
<th width="150">Name</th>
<th width="100">Type</th>
<th width="50">Date</th>
<th width="50">From</th>
<th width="50">To</th>
<th width="30">Price</th>
<th width="30">Paid</th>
<th width="30">Remaind</th>
<th colspan="4">Actions</th>
</tr>
<?
$i=1;
while($objResult=mysql_fetch_array($objQuery)){
?>
<tr id="vip_row<?=$objResult["vip_id"];?>" <? echo ($i%2==0?'bgcolor="#edf0f6"':''); ?>>
<td><input name="cbSelect[]" type="checkbox" id="cbSelect[]" value="<?=$objResult["vip_id"]; ?>" /></td>
<td><?=$objResult["customer_name"]; ?></td>
<td><?=$objResult["vip_type"]; ?></td>
<td><?=$objResult["vip_date"]; ?></td>
<td><?=$objResult["vip_from"]; ?></td>
<td><?=$objResult["vip_to"]; ?></td>
<td><?=$objResult["vip_price"]; ?></td>
<td><?=$objResult["vip_paid"]; ?></td>
<td><?=$objResult["vip_remind"]; ?></td>
<td width="16"><a href="index.php?body=edit_vip&id=<?=$objResult["vip_id"];?>" original-title="Edit and View VIP Information"><img width="15" height="15" class="tabpimpa" alt="picture" src="images/edit.png"></a></td>
<td width="16"><a href="#" onClick="delete_vip('<?=$objResult["vip_id"];?>');" original-title="Delete VIP"><img width="15" height="15" class="tabpimpa" alt="picture" src="images/delete.png"></a></td>
<td width="16"><a href="print_single_bills_vip.php?id=<?=$objResult["vip_id"];?>" target="_new"><img width="15" height="15" class="tabpimpa" alt="picture" src="images/print.png"></a></td>
<td width="16"><a href="#" onClick="vip_to_egypt('<?=$objResult["vip_id"];?>');"><img width="15" height="15" class="tabpimpa" alt="picture" src="images/sms.png"></a></td>
</tr>
<? ++$i; } ?>
</tbody></table>
該網格將獲得來自數據庫的數據,我想導出這個結果數據到Excel。
我該怎麼做?
你能詳細點嗎? _如何使用phpexcel? – 2013-04-04 07:17:28
Stuart M:爲PHP編程語言提供一組類的項目,它允許您從不同的電子表格文件格式(如Excel(BIFF).xls,Excel 2007(OfficeOpenXML).xlsx,CSV,Libre/OpenOffice Calc .ods,Gnumeric,PDF,HTML,...這個項目是圍繞微軟的OpenXML標準和PHP構建的。 -by phpexcel site – dreamweiver 2013-04-04 07:23:09
很酷,我只是回顧這個答案,因爲它被標記爲太短的審查。通過編輯它,您的評論將非常適合添加到答案本身! – 2013-04-04 07:24:18