Home >Backend Development >PHP Tutorial >COM in PHP (winows only)

COM in PHP (winows only)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 14:31:20798browse
找了很久,终于给我找到!哈哈哈... 
//听说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支持. 
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn