在php中如何使用com(仅适合windows系统)
程序员文章站
2022-06-03 11:32:31
...
//听说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支持.
// 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教程有兴趣的朋友有所帮助。