new COM

resource new COM(string component, [string remote_server]) 
component Component to load
remote_server Optional remote server for DCOM

Creates a new instance of a COM object.

Returns:

Instance of COM object

Description:

This is technically not a function but a constructor to a reserved class called COM for accessing COM objects in PHP 4.0. This is functionally similar to com_load in PHP 3.0. From here you can easily call functions and read properties from the new COM object. For setting properties in the COM object, use com_set() and com_get(). In ASP, the code in the following example would be written as follows:

set com = Server.CreateObject("ObjectName.ClassName") 

Version:

Existing since version 4.0

Example:

Create and read from ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.