Accessing COM objects from PHP

PHP4 no longer uses the com_load function anymore. Instead, you can use the COM object:

<?
$word=new COM("word.application") or die("Cannot start word for you");
print "Loaded word version ($word->Version)\n";
$word->visible =1;
$word->Documents->Add();
$word->Selection->Typetext("Dit is een test");
$word->Documents[1]->SaveAs("burb ofzo.doc");
$word->Quit();
?>

If you are still using PHP 3, then you can use the com_load function.

You might also like...

Comments

 Alt-PHP-Faq

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Some people, when confronted with a problem, think "I know, I’ll use regular expressions." Now they have two problems.” - Jamie Zawinski