3
你好,我可以使用下面的代碼。出口功能工作正常,但沒有出口與圖像爲什麼?請幫幫我。PHP導出excel與圖像
<?php
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/vnd.ms-excel; charset=UTF-8");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=member_list.xls");
?>
<table cellpadding="0" cellspacing="0" border="0" class="table table-bordered">
<thead>
<tr><th colspan="6"><h3>Member List</h3></th></tr>
<tr>
<th>ID</th>
<th>Name</th>
<th>Email</th>
<th>Phone No</th>
<th>Date of Birth</th>
<th>Profile Image</th>
<th>Status</th>
<th>InsertDate</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($memberlist))
{
foreach ($memberlist as $row){ ?>
<tr class="gradeX odd">
<td><strong><?php echo $row->id;?></strong></td>
<td><?php echo $row->display_name;?></td>
<td><?php echo $row->user_email;?></td>
<td><?php echo $row->phone;?></td>
<td><?php echo $row->dob;?></td>
<td><img src="<?php echo base_url().'uploads/images/member/'.$row->profile_image;?>" width="80" height="65" /><?php echo base_url().'uploads/images/member/'.$row->profile_image;?></td>
<?php
if($row->is_active == 1)
{
?>
<td>Active</td>
<?php
}
else
{
?>
<td>Inactive</td>
<?php
}
?>
<td><?php echo $row->insertdate;?></td>
</tr>
<?php } } ?>
</tbody>
</table>
?>
如何導出我的excel與一列他們是顯示圖像。我們需要這個帶有八欄的導出文件,如果在我的數據中找到第六欄,則顯示圖像。
這不是一個Excel文件,這是簡單的HTML標記以.xls –
的延伸,你一定要明白,只有最後一個Content-Type頭(你正在嘗試設置4)將被髮送到瀏覽器 –