xmlArray

Description

Creates a new xmlArray object, which is an simple xml dom parser.

Syntax

void xmlArray (mixed $data[, bool $auto_trim[, int $error_level[, bool $is_clone]]])



Parameter $data

Expected type: Mixed
Description: The XML data

Allowed types for $data
Allowed values Description
String A string of XML data
Array An array of XML data - each item is a line of XML data (such as from file())



Parameter $auto_trim

Expected type: Boolean
Description: Whether or not to trim the elements. Default is false



Parameter $error_level

Expected type: Integer
Description: Error reporting level (see PHP manual). Default is null, meaning it will use the value set in index.php. Used to determine whether or not to generate notices for missing/undefined elements.



Parameter $is_clone

Expected type: Boolean
Description: If true, then this xmlArray is the clone of another xmlArray. Used internally only. Default is false.


Notes

  • Usage: $xml = new xmlArray(file('data.xml'));
  • Data should be the xml data or an array of, unless is_clone is true.
  • auto_trim can be used to automatically trim textual data.
  • error_level specifies whether notices should be generated for missing elements and attributes.
  • If is_clone is true, the xmlArray is cloned from another - used internally only.
Advertisement: