ServersCOM support on Windows Page 5

COM support on Windows Page 5

ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

On Windows platforms, PHP4
now offers support for COM components. This means that practically
all Windows applications can be manipulated from PHP4. The COM model
at the heart of Microsoft’s architecture is such that any
Windows application can provide a certain number of components and
exposed methods, which are entry points for manipulating
applications from other applications.

A few lines of code tend to be more useful than a long
description, so let’s examine the following example. The code below
does nothing less than boot Word, create a new document from it, add
text to this document, and then save everything on the disk before

$word = new COM(“word.application”)
 die(“Impossible to instantiate
print “Word is running, version


is a test…”);


Get the Free Newsletter!

Subscribe to Daily Tech Insider for top news, trends & analysis

Latest Posts

Related Stories