XML is a markup language that looks a lot like HTML. An XML document is plain text and contains tags delimited by < and >

HTML list that is not valid XML

   <li>list item one
   <li>list item two
   <li>list item three

HTML list that is valid XML

   <li>list item one</li>
   <li>list item two</li>
   <li>list item three</li>

Parsing an XML Document using PHP5


   $channel =<<<_XML_
      <title>What's For Today's Dinner<title>
      <description>Choose what to eat :</description>
   $xml = simplexml_load_string($channel);
   print "The $xml->title channel is available at $xml->link. ";
   print "The description is \"$xml->description\"";

It will produce the following result:

The What's For Today's Dinner channel is available at The description is "Choose what to eat :"

PHP Online Test

« Previous Tutorial CodesCracker Home »

Follow/Like Us on Facebook

Subscribe Us on YouTube