php word html转换

 $str .=" 
<tr align='center'>
<td rowspan='2' style='text-align: left'>督导结果</td>
<td colspan='4' style='text-align: left'>本投放点居民主动分类投放垃圾的_{$zhutong}_户,正确分类_{$idac}_户;现场指导居民分类投放_{$zhidao}_户;未分类_{$weifenlei}_户;不愿意配合分类的居民_{$bupei}_户。</td>
<td rowspan='2' style='text-align: left'></td>
</tr>
<tr align='center'>
<td colspan='4' style='text-align: left'>现场发现问题点:{$cadi['problems']}</td>
</tr>
<tr align='center'>
<td rowspan='2' style='text-align: left'>居民意见</td>
<td colspan='4' style='text-align: left'>1.{$cadi['opinions']}</td>
<td rowspan='2' style='text-align: left'></td>
</tr>
<tr align='center'>
<td colspan='4' style='text-align: left' >2.</td>
</tr>
</table>
</div>";

header("Cache-Control: no-cache, must-revalidate");

header("Pragma: no-cache");

header("Content-Type: application/octet-stream");

header("Content-Disposition: attachment; filename=$fileName");


$html = '<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">';
$html .= '<head><meta charset="UTF-8" /></head>';

echo $html . '<body>'.$str .'</body></html>';
点赞

发表评论