Here is the example of creating word document using php.
<?php
$wordObj = new COM("word.application") or die ("Could not create an instance of word");
echo "Version : {$wordObj->version}";
$wordObj->visible = 1;
$wordObj->Documents->Add();
$wordObj->Selection->TypeText("Hello World.."); // add text here
$wordObj->Documents[1]->SaveAs("sample.doc"); // save location
$wordObj->Quit();
$wordObj->Release(); //free object
$wordObj = null;
?>
Is there any other way to make doc file without using component..
ReplyDelete