Home  >  Article  >  Backend Development  >  PHP4 support for WindowsCOM_PHP tutorial

PHP4 support for WindowsCOM_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:24:46846browse

On Windows platforms, PHP4 now supports COM.
This means that PHP4 can actually operate all Windows applications.
The COM module at the heart of Microsoft allows any Windows application to
provide a certain number of components and other methods as an entry point for manipulating another
application.

A few lines of short code may be more effective than a detailed description. Next, let's take a look at an example of
: it starts Word, creates a new document, adds text and saves it to disk.

$word = new COM("word.application") or die("Impossible to instantiate WordApp");
print "Word is running, version {$word-> Version}n";
$word->Visible=1;
$word->Documents->Add();
$word->Selection->TypeText("This is a test ...");
$word->Documents[1]->SaveAs("test_com_php.doc");
$word->Quit();
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532098.htmlTechArticleOn the Windows platform, PHP4 now supports COM. This means that PHP4 can actually operate all Windows applications. The COM module at the heart of Microsoft allows any Windows application to...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn