COM in PHP (winows only)
程序员文章站
2022-05-21 12:26:17
...
找了很久,终于给我找到!哈哈哈...
//听说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支持.
//听说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支持.
上一篇: C#综合揭秘——细说多线程(下)
下一篇: php 完美的ereg验证文件上传
推荐阅读
-
php如何实现ppt转图片以及php调用com组件问题的详细介绍
-
PHP5.4错误 Notice: Only variable references should be returned by reference
-
PHP4调用自编COM组件_PHP教程
-
http://www.hunanzhibo.com/ php文章内容分页并生成相应的htm静态页面代码
-
php通过Chianz.com获取IP地址与地区的方法_PHP
-
PHP调用VC编写的COM组件实例_PHP教程
-
PHP调用VC编写的COM组件实例
-
PHP调用VC编写的COM组件实例_PHP
-
PHP基于COM的Excel操作类(PHP5)
-
PHP4 调用自己编写的 COM 组件_PHP