API - PHP Example Application
In order to run this example, you will need:
- A system with PHP 4 or higher installed
- The cURL PHP library (included with most installs)
- The DOM PHP library (included with most installs)
- A basic understanding of the PHP programming language
Download ExamplePHP.zip. This example contains the following files:
Running the Example
To run the example, place the file on your PHP enabled server. The URL to request is hardcoded in the source as the $URL variable. If you encounter any class not found errors, verify that you have the cURL and DOM libraries installed.
The Source Code
This example uses PHP's cURL and DOM libraries to request and parse the XML.
This function uses cURL to request the XML. The resulting XML is returned as a String.
This function takes the XML String and parses it into a DOMDocument.
This function uses the DOMDocument to access the XML as a DOM tree. Nodes of the tree are retrieved by name and looped through to output the form result's information.