protected function getIDs( \DOMDocument $dom_doc, $tag = 'footnoteReference', $attr = 'w:id' ) {
		$fn_ids = [];
		$doc_elem = $dom_doc->documentElement;

		$tags_fn_ref = $doc_elem->getElementsByTagName( $tag );

		// if footnotes are in the document, get the ids
		if ( $tags_fn_ref->length > 0 ) {
			foreach ( $tags_fn_ref as $id ) {
				/** @var \DOMElement $id */
				if ( '' !== $id->getAttribute( $attr ) ) { // don't add if its empty
					$fn_ids[] = $id->getAttribute( $attr );
				}
			}
		}

		return $fn_ids;
	}
protected function getIDs( \DOMDocument $dom_doc, $tag = 'footnoteReference', $attr = 'w:id' ) {
		$fn_ids = [];
		$doc_elem = $dom_doc->documentElement;

		$tags_fn_ref = $doc_elem->getElementsByTagName( $tag );

		// if footnotes are in the document, get the ids
		if ( $tags_fn_ref->length > 0 ) {
			foreach ( $tags_fn_ref as $id ) {
				/** @var \DOMElement $id */
				if ( '' !== $id->getAttribute( $attr ) ) { // don't add if its empty
					$fn_ids[] = $id->getAttribute( $attr );
				}
			}
		}

		return $fn_ids;
	}
protected function getIDs ( \ DOMDocument $ dom_doc , $ tag = 'footnoteReference' , $ attr = 'w:id' ) { $ fn_ids = [ ] ; $ doc_elem = $ dom_doc -> documentElement ; $ tags_fn_ref = $ doc_elem -> getElementsByTagName ( $ tag ) ; // if footnotes are in the document, get the ids if ( $ tags_fn_ref -> length > 0 ) { foreach ( $ tags_fn_ref as $ id ) { /** @var \DOMElement $id */ if ( '' !== $ id -> getAttribute ( $ attr ) ) { // don't add if its empty $ fn_ids [ ] = $ id -> getAttribute ( $ attr ) ; } } } return $ fn_ids ; }
Given a documentElement, it will return an array of ids

@param \DOMDocument $dom_doc
@param string $tag
@param string $attr

@return array
Given a documentElement it will return an array of ids