CIF_lib
[ class tree: CIF_lib ] [ index: CIF_lib ] [ all elements ]

Procedural File: xml2array.phtml

Source Location: /xml2array.phtml



Page Details:









xml2array [line 12]

void xml2array( $contents, [ $get_attributes = 1], [ $priority = 'tag'])

xml2array() will convert the given XML text to an array in the XML structure.

Link: http://www.bin-co.com/php/scripts/xml2array/ Arguments : $contents - The XML text $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the tag values - this results in a different array structure in the return value. $priority - Can be 'tag' or 'attribute'. This will change the way the resulting array sturcture. For 'tag', the tags are given more importance. Return: The parsed XML in an array form. Use print_r() to see the resulting array structure. Examples: $array = xml2array(file_get_contents('feed.xml')); $array = xml2array(file_get_contents('feed.xml', 1, 'attribute'));




Parameters

   $contents  
   $get_attributes  
   $priority  
[ Top ]



Documentation generated on Tue, 28 May 2024 19:03:23 +0200 by phpDocumentor 1.4.3