Php generates Word documents. Use php to generate word documents. the generated word files can be opened by software such as word and wps. The code is as follows: functionword ($ data, $ fileName) {if (empty ($ data) return; $ datahtmlx uses php to generate a word document. the generated word file can use word, open wps and other software. The 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);}
Example:
Use php to create word documentsUse php to create a word document by phpernote.com
If you open Word.doc and see the introduction here, the word document is created successfully.
Copyright:
Www.phpernote.com
'; Word ($ str );
:
Articles you may be interested in
- Php idea and implementation method for generating short URLs
- Several methods for generating random numbers using PHP
- PHP random password generation function
- Summary of methods for generating random passwords in php
- How php generates image thumbnails
- Php QR code generation method summary
- PHP generates instances of download links for thunder, express train, and QQ tornado.
- Php verification code generation function
Bytes. The code is as follows: function word ($ data, $ fileName = '') {if (empty ($ data) return''; $ data = 'HTML x...