php - PHPWord how to replace HTML Tags -
i creating word doc using phpword. content of doc dynamic , content may contain html tag following:
<strong>problem statement</strong> <p>the text may be<em>bold</em> subject peculiar conditions</p> <ul> <li>test 1</li> <li>test 2</li> </ul>
the doc creating in doc content showing html tags.
how replace these tags proper word document tags word doc shows same html view proper formatting.
i suggest make function this:
function converttags($text){ $text= str_replace("<strong>", "<w:b val="true"/>", $text); $text= str_replace("</string>", "<w:b val="false"/>", $text); // , tags that. may use array , loop through it. return $text; }
Comments
Post a Comment