Php word document _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.