Preparing to Use XML with PHP

The XML extension for PHP uses the expat library to work with XML documents. XML functionality is enabled by default at the time of PHP configuration and installation; if you're using version of Apache greater than 1.3.9 (and you should be!), the bundled expat library will be used.

However, Linux/UNIX users who want to use a different version of expat can get it from and then add the following to the PHP configure parameters:

 --with-expat-dir=[path to expat directory] 

After running the configure program again, go through the make and make install process as you did in Chapter 1. Then restart your Web server and look at the output of the phpinfo() function. You should see a section called "xml," and you're looking for something that says "xml support active."

Windows users, regardless of Web server software, have no changes to make, as XML support is built into the Windows version of PHP.

Once XML support is enabled, you can move on to parsing, transforming, and even generating XML using PHP. All of the examples used in this chapter are very basic, and again I recommend you do a great deal of reading on your own if you're interested in working with XML to any great extent.

PHP Essentials
PHP Essentials, 2nd Edition
ISBN: 1931841349
EAN: 2147483647
Year: 2002
Pages: 74 © 2008-2017.
If you may any questions please contact us: