ThinkPHP6使用COM时报错Class 'app\controller\COM' not found的解决方法

{{ time }}

在ThinkPHP下要这么写

$word = new \COM("Word.Application") or die("Could not initialise Object.");

区别于一般PHP, 要使用\COM

参考文献:

http://www.thinkphp.cn/topic/28501.html