首页 > 开发 > PHP > 正文

COM in PHP (winows only)

2024-05-04 23:00:51
字体:
来源:转载
供稿:网友
  • 本文来源于网页设计爱好者web开发社区http://www.html.org.cn收集整理,欢迎访问。
  • 找了很久,终于给我找到!哈哈哈...  
    //听说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支持.  
    发表评论 共有条评论
    用户名: 密码:
    验证码: 匿名发表