//I heard that php4 also supports java/EJB.
// this script is come from zend. :)
$Word = new COM("word.application") or die("Unable to instanciate Word
");
PRint "Loaded Word, version {$word->Version}n";
$word->Visible = 1;
$word->Documents->Add();
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");
$word->Quit();
?>
Note: Use phpinfo() first to see if your machine has COM support turned on.
The above introduces how to use com in PHP (only suitable for Windows systems), including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.