Changeset 85762 in spip-zone
- Timestamp:
- Oct 31, 2014, 1:17:28 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/iterateurs/iterateur/data.php
r70239 r85762 420 420 */ 421 421 function inc_xml_to_array_dist($u) { 422 return @ObjectToArray(new SimpleXmlIterator($u)); 422 return @XMLObjectToArray(new SimpleXmlIterator($u)); 423 } 424 /** 425 * 426 * object -> tableau 427 * 428 * @param object $object The object to convert 429 * @return array 430 * 431 */ 432 function inc_object_to_array( $object ) { 433 if( !is_object( $object ) && !is_array( $object ) ) { 434 return $object; 435 } 436 if( is_object( $object ) ) { 437 $object = get_object_vars( $object ); 438 } 439 return array_map( 'inc_object_to_array', $object ); 423 440 } 424 441 … … 437 454 return false; 438 455 } 439 return (array) $w;456 return inc_object_to_array($w); 440 457 } 441 458 … … 570 587 * @return array|bool 571 588 */ 572 function ObjectToArray($object){589 function XMLObjectToArray($object){ 573 590 $xml_array = array(); 574 591 for( $object->rewind(); $object->valid(); $object->next() ) {
Note: See TracChangeset
for help on using the changeset viewer.