Using COM with PHP

New to PHP 4 is support for COM on Windows operating systems. COM, which stands for Component Object Module, is a technology developed by Microsoft to control its applications via a programming language, notably Visual Basic. It is related to other Microsoft systems such as OLE (Object Linking and Embedding) and ActiveX.

Microsoft has defined every function and attribute that an application—such as Word or Excel—has as an object with methods and properties. Using the proper notation you can then control the application with Visual Basic or, in your case, PHP. You begin by creating a new object using the name of the application and PHP's com() function.

$word = new COM("word.application"); 

You can set the application to run ...

Get PHP Advanced for the World Wide Web: Visual QuickPro Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.