Using PHP to generate Word documents, the resulting Word file can be opened with software such as Word,wps. The specific code is as follows:
function Word ($data, $fileName = ') {if (empty ($data)) return '; $data = '. $data. '; if (empty ($fileName)) $fileName =date (' Ymdhis '). Doc '; $fp =fopen ($fileName, ' WB '); fwrite ($fp, $data); fclose ($FP);}
Examples are as follows:
Create a Word document with PHP
Author: phpernote.com
If you open Word.doc and see the introduction here, the Word document was created successfully.
All rights reserved:
Www.phpernote.com
'; Word ($STR);
:
Articles you may be interested in
- The idea and implementation method of PHP generating short URLs
- Several methods of generating random numbers in PHP
- PHP generates random cipher functions
- Summary of methods for generating random passwords in PHP
- How PHP generates image thumbnails
- A summary of the method of generating two-dimensional code in PHP
- PHP generated Thunder, Express, QQ whirlwind download Link instance
- PHP Generate Captcha function
http://www.bkjia.com/PHPjc/764098.html www.bkjia.com true http://www.bkjia.com/PHPjc/764098.html techarticle using PHP to generate Word documents, the resulting Word file can be opened with software such as Word,wps. The specific code is as follows: function word ($data, $fileName = ") {if (empty ($data)) return '; $data = ' html x ...