Introduction to PHP for Os X by Example

XML

  • Use simplexml_load_string() to parse and pass an XML file to a variable. This function (and its associates) makes it extremely easy to deal with XML content.
  • If we know the structure of the XML content we can simply refer to the data in the content via the XML’s file tree structure and element names. e.g. $xml_var->lvl1_name->lvl2_name->item_we_want