Simple XML Object to Array

Public

</> CopyGet raw version
php
  1. function xml2array ( $xmlObject, $out = array () )
  2. {
  3. foreach ( (array) $xmlObject as $index => $node )
  4. $out[$index] = ( is_object ( $node ) ) ? xml2array ( $node ) : $node;
  5.  
  6. return $out;
  7. }