(PHP 4 >= 4.1.0, PHP 5, PHP 7)
Examples:
COM example (1)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
// starting word
$word new COM("word.application"or die("Unable to instantiate Word");
echo "Loaded Word, version {$word->Version}\n";
 
//bring it to front
$word->Visible = 1;
 
//open an empty document
$word->Documents->Add();
 
//do some weird stuff
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");
 
//closing word
$word->Quit();
 
//free the object
$word = null;
?>
COM example (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
 
$conn new COM("ADODB.Connection"or die("Cannot start ADO");
$conn->Open("Provider=SQLOLEDB; Data Source=localhost;
Initial Catalog=database; User ID=user; Password=password");
 
$rs $conn->Execute("SELECT * FROM sometable");    // Recordset
 
$num_columns $rs->Fields->Count();
echo $num_columns "\n";
 
for ($i=0; $i $num_columns$i++) {
    $fld[$i] = $rs->Fields($i);
}
 
$rowcount = 0;
while (!$rs->EOF) {
    for ($i=0; $i $num_columns$i++) {
        echo $fld[$i]->value . "\t";
    }
    echo "\n";
    $rowcount++;            // increments rowcount
    $rs->MoveNext();
}
 
$rs->Close();
$conn->Close();
 
$rs = null;
$conn = null;
 
?>
com_create_guid
  • References/PHP/Function/Windows Only/COM

(PHP 5, PHP 7) Generate a globally unique identifier (GUID)

2025-01-10 15:47:30
variant_imp
  • References/PHP/Function/Windows Only/COM

(PHP 5, PHP 7) Performs a bitwise implication on two variants

2025-01-10 15:47:30
variant_add
  • References/PHP/Function/Windows Only/COM

(PHP 5, PHP 7) "Adds" two variant values together and returns the result

2025-01-10 15:47:30
variant_set_type
  • References/PHP/Function/Windows Only/COM

(PHP 5, PHP 7) Convert a variant into another type "in-place"

2025-01-10 15:47:30
variant_cat
  • References/PHP/Function/Windows Only/COM

(PHP 5, PHP 7) concatenates two variant values together and returns the result

2025-01-10 15:47:30
variant_idiv
  • References/PHP/Function/Windows Only/COM

(PHP 5, PHP 7) Converts variants to integers and then returns the result from dividing them

2025-01-10 15:47:30
variant_neg
  • References/PHP/Function/Windows Only/COM

(PHP 5, PHP 7) Performs logical negation on a variant

2025-01-10 15:47:30
variant_sub
  • References/PHP/Function/Windows Only/COM

(PHP 5, PHP 7) Subtracts the value of the right variant from the left variant value

2025-01-10 15:47:30
com_message_pump
  • References/PHP/Function/Windows Only/COM

(PHP 4 >= 4.2.0, PHP 5, PHP 7) Process COM messages, sleeping for up to timeoutms milliseconds

2025-01-10 15:47:30
variant_set
  • References/PHP/Function/Windows Only/COM

(PHP 5, PHP 7) Assigns a new value for a variant object

2025-01-10 15:47:30