php中COM函数的使用

php里的com类可以操作window系统上的东西
例如:可以在本地打开一个word文档,然后写入东西,只用于window系统
需要加载php_com_dotnet.dll模块
 
 1 $word = new COM("word.application") or die("Unable to instantiate Word");
 2 echo "Loaded Word, version {$word->Version}
";
 3  
 4 //bring it to front
 5 $word->Visible = 1;
 6  
 7 //open an empty document
 8 $word->Documents->Add();
 9  
10 //do some weird stuff
11 $word->Selection->TypeText("This is a test...");
12 $word->Documents[1]->SaveAs("Useless test.doc");
13  
14 //closing word
15 $word->Quit();
16  
17 //free the object
18 $word = null;
原文地址:https://www.cnblogs.com/redfire/p/7689724.html