src/SimpleDOM.php
public function buildReferenceLookupTable($strNodeName, $strIndexAttribute = 'name')
    {

        $arrOut = array();

        if (!isset($this->$strNodeName)) {
            return array();
        }

        foreach ($this->$strNodeName as $objNode) {
            $strIndex = (string)$objNode->attributes()->$strIndexAttribute;
            $arrOut[$strIndex] = $objNode;
        }

        return $arrOut;
    }
public function buildReferenceLookupTable($strNodeName, $strIndexAttribute = 'name')
    {

        $arrOut = array();

        if (!isset($this->$strNodeName)) {
            return array();
        }

        foreach ($this->$strNodeName as $objNode) {
            $strIndex = (string)$objNode->attributes()->$strIndexAttribute;
            $arrOut[$strIndex] = $objNode;
        }

        return $arrOut;
    }
public function buildReferenceLookupTable ( $ strNodeName , $ strIndexAttribute = 'name' ) { $ arrOut = array ( ) ; if ( ! isset ( $ this -> $ strNodeName ) ) { return array ( ) ; } foreach ( $ this -> $ strNodeName as $ objNode ) { $ strIndex = ( string ) $ objNode -> attributes ( ) -> $ strIndexAttribute ; $ arrOut [ $ strIndex ] = $ objNode ; } return $ arrOut ; }
Build an array with references to subnodes of this xml element
Indexed by an urified index attribute (standard 'name')

@param string $strNodeName name of the subnode
@param string $strIndexAttribute name of the attribute used as array index
@return static[]
Build an array with references to subnodes of this xml element Indexed by an urified index attribute ( standard name )