This example describes how to create a Word document in PHP. Share to everyone for your reference, specific as follows:
about using PHP to generate word, found a lot of information on the Internet, there are calls to COM components generated by the installation of PHP extensions generated. is not easy, the following is a more concise method, and Cross-platform.
The following is the detailed code:
class.word.php
<?php
class word{
function Start () {
ob_start ()///Open Output control buffer
echo '
index.php
<?php include ("class.word.php"); $word =new Word (); $word->start ();// The following is saved in a Word file, you can use HTML tags?>
More interested in PHP related content readers can view the site topics: "PHP Network Programming Skills Summary", "PHP basic Grammar Introductory Course", "PHP operation Office Document Skills Summary (including word,excel,access,ppt)", " PHP Date and Time usage summary, PHP Introduction to object-oriented Programming, PHP String (String) Usage summary, PHP+MYSQL database Operations Tutorial and PHP Common database operating Skills summary
I hope this article will help you with the PHP program design.