Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 29. Integrating Flex Application... > Using PHP with HTTPService and XML

29.3. Using PHP with HTTPService and XML

You can integrate Flex applications with PHP using the Flex SDK's HTTPService component and PHP pages that generate structured XML-based content on the server. To return structured data from a PHP page, you can either generate your own XML content with conventional text concatenation or you can use a more reliable approach that requires an external library to serialize XML packets.

29.3.1. Using the PHP SimpleXML extension

The PHP page in Listing 29.1 uses a PHP5 extension named SimpleXML to generate and return an XML-formatted response with literal values in each of the XML elements. The header() function is used to inform the client application that the content is being delivered with the xml/text content type.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint