• home
  • forum
  • my
  • kt
  • download
  • Using XML

    Author: 2008-08-15 07:24:29 From:

    After the hype, the Extensible Markup Language (XML) is now really used almost everywhere. An application that receives a lot of buzz is Web Services, a technology that is covered in detail in Chapter 9, "Communicating with Others." However, XML can be used elsewhere, as well. It is a good format to store any kind of data.

    The tasks behind using XML are always the same: reading data from XML and writing data into it. So this chapter focuses on these tasks and shows how to implement them.

    Unfortunately, PHP 4's XML support was somewhat limited. Some extensions did not prove to be very stable. This changed drastically with PHP 5 and a revamped XML support. Therefore, the main focus of this chapter is on PHP 4. In PHP 5.1, some new features will be added that are already covered in this chapter.

    As the sample XML file and format in this chapter, the XML from the following code reuses the quotes database example from the previous chapter. As you can see, <quotes> is the root element, and each quote (including its author and the year the coding was coined) is contained in a <quote> element.

    The sample XML file (quotes.xml; excerpt)
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <quotes>
      <quote year="1991">
        <coding>Hasta la vista, baby!</coding>
        <author>Arnold Schwarzenegger</author>
      </quote>
    </quotes>
    

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Ad Management (4)
      Calendars (3)
      Chat Systems (7)
      Content Management (6)
      Cookies and Sessions (8)
      Counters (8)
      Database Related (8)
      Date and Time (9)
      Development (6)
      Discussion Boards (7)
      E Commerce (6)
      Email Systems (9)
      Error Handling (5)
      File Manipulation (10)
      Flash and PHP (4)
      Form Processing (7)
      Guestbooks (8)
      Image Manipulation (3)
      Installing PHP (5)
      Introduction to PHP (9)
      Link Indexing (6)
      Mailing List Management (8)
      Miscellaneous (10)
      Networking (6)
      News Publishing (6)
      OOP (8)
      PEAR (6)
      PHP vs Other Languages (2)
      Polls and Voting (5)
      Postcards (0)
      Randomizing (8)
      Redirection (8)
      Searching (6)
      Security (6)
      Site Navigation (7)
      User Authentication (10)
      WAP and WML (7)
      Web Fetching (0)
      Web Traffic Analysis (11)
      XML and PHP (6)

    New

    Hot