可以,下面就是php手册上调用com的例子// starting word
$word = new COM("word.application") or die("Unable to instanciate Word");
print "Loaded Word, version {$word->Version}\n";//bring it to front
$word->Visible = 1;//open an empty document
$word->Documents->Add();//do some weird stuff
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");//closing word
$word->Quit();//free the object
$word->Release();
$word = null;
$word = new COM("word.application") or die("Unable to instanciate Word");
print "Loaded Word, version {$word->Version}\n";//bring it to front
$word->Visible = 1;//open an empty document
$word->Documents->Add();//do some weird stuff
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");//closing word
$word->Quit();//free the object
$word->Release();
$word = null;
解决方案 »
- php做客户端,java做服务端,用webservice怎么交互
- 求解 这样的数据格式
- 关于.htaccess多域名解析不同目录的问题,请帮忙
- 非计算机专业能从事WEB开发吗?能找到工作吗?
- 各位好,我打算学习php,请问该如何下手呢?
- 1只女菜鸟在树上等你呢
- 用数据源的方式连接数据库应如何实现分页(急,在线等待)
- 如何解析收藏夹导出的htm文件到一个变量中,请给出代码,谢谢
- 在php页面,如果对生成的临时表执行select
- 有一个这样的数组,如何遍历出每级别下面的username数量,级别有n级
- 能否提供mysql的较完整的在线教程......
- 如何用php将几个文件打包成zip文件?(linux平台)
需要手动注册
regever32 注册文件
载入 PHP 扩充模块。
语法: int dl(string library);
返回值: 整数
函数种类: PHP 系统功能
内容说明
本函数可动态的载入 PHP 所需的外部扩充模块 library。
eg:
<?
if (!extension_loaded('gd')) {
if (!dl('gd.so')) {
exit;
}
}
?>
Note: dl() is not supported in multithreaded Web servers. Use the extensions statement in your php.ini when operating under such an environment. However, the CGI and CLI build are not affected ! Note: dl() is case sensitive on unix platforms.
com()用在 win?
我写了一个test.so,用dl无法加载?
Warning: Invalid library (maybe not a PHP library) 'test.dll' in E:\web\www\php_test\index.php on line 2php library 怎么写了?