Home>Article>Backend Development> How to convert html to word in php?
php method to convert html to word: 1. Generate word through mnt media, the code is [composer require cshaptx4869/html2word]; 2. Write the html file directly into word, and convert the image to base64 format.
How to convert html to word using php:
1. Generate word
through the medium of mntcomposer require cshaptx4869/html2word
'.$content.''; if (empty($fileName)) { $fileName = date('YmdHis').'.doc'; } file_put_contents($fileName, $content); }
2. Write the html file directly into word
Note: If there are pictures, convert them to base64 format
'; $html .= ' '; echo $html . ''.$content .'