Wpwh_Helpers::XML2Array( $parent )


Parameters Parameters

$parent

(Required)


Top ↑

Return Return

(array)


Source Source

File: src/integrations/wp-webhooks/helpers/wpwh-helpers.php

	public function XML2Array( \SimpleXMLElement $parent ) {
		$array = array();
		foreach ( $parent as $name => $element ) {
			( $node = &$array[ $name ] )
			&& ( 1 === count( $node ) ? $node = [ $node ] : 1 )
			&& $node = &$node[];
			$node = $element->count() ? $this->XML2Array( $element ) : trim( $element );
		}
		return $array;
	}