//聽說php4也已經支援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();
?>
注意:先用phpinfo()看看你的機器是否打開了COM支援.
以上就介紹了在php中如何使用com(只適合windows系統),包括了方面的內容,希望對PHP教程有興趣的朋友有所幫助。