图片用绝对地址写入word<?php
header("Content-Type: application/msword");
header("Content-Disposition: attachment; filename=img.doc");
header("Pragma: no-cache");
header("Expires: 0");
$output = '<table border="1" cellspacing="2" cellpadding="2" width="90%" align="center">';
$output .= '<tr bgcolor="#cccccc"><td align="center">图片</td></tr>';
$output .= '<tr bgcolor="#f6f7fa"><td>下面是一张图片</td></tr>';
$output .= '<tr><td align="center"><img src="http://localhost/test.jpg"></td></tr>';
$output .= '</table>';
echo $output;
?>
header("Content-Type: application/msword");
header("Content-Disposition: attachment; filename=img.doc");
header("Pragma: no-cache");
header("Expires: 0");
$output = '<table border="1" cellspacing="2" cellpadding="2" width="90%" align="center">';
$output .= '<tr bgcolor="#cccccc"><td align="center">图片</td></tr>';
$output .= '<tr bgcolor="#f6f7fa"><td>下面是一张图片</td></tr>';
$output .= '<tr><td align="center"><img src="http://localhost/test.jpg"></td></tr>';
$output .= '</table>';
echo $output;
?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货