This article for everyone to share is that PHP output data as word and the data in the IMG can be displayed, the need for friends can refer to
$case _title1 = "abc"; $content = "Catwoe<span>implement</span>" $content = Str_replace ("src=\"/"," src=\ "http://fangmingdesign.net/method/image/", $all _ lists);//give is a relative path to the picture plus the domain name into an absolute path, the exported Word will display the picture $filename = iconv (' utf-8 ', ' gb2312 ', $case _title1); Header (' Pragma:public '); Header (' content-type:application/vnd.ms-word;charset=utf-8;name= '. $case _title1. ' ". Doc '); Header ("Content-disposition:attachment;filename= $filename. Doc")//attachment new window print inline this window print $html = ' < HTML xmlns:o= "Urn:schemas-microsoft-com:office:office" xmlns:w= "Urn:schemas-microsoft-com:office:word" xmlns= "HTTP://WWW.W3.ORG/TR/REC-HTML40" ><meta http-equiv= "Content-type" content= "text/html"; Charset=utf-8 "/>";//This sentence can not be less, otherwise cannot recognize the picture echo $html. $content. '