PHP Build Word Document _php Tutorial

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

  • Related Article

    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.