gan_node_html.php
function &getChild($child, $ignore_text_comments = false) {
		if (!is_int($child)) {
			$child = $this->findChild($child);
		} elseif ($child < 0) {
			$child += $this->childCount($ignore_text_comments);
		}

		if ($ignore_text_comments) {
			$count = 0;
			$last = null;
			//foreach($this->children as &$c) {
			//	if (!$c->isTextOrComment()) {
			//		if ($count++ === $child) {
			//			return $c;
			//		}
			//		$last = $c;
			//	}
			//}

			foreach(array_keys($this->children) as $k) {
				if (!$this->children[$k]->isTextOrComment()) {
					if ($count++ === $child) {
						return $this->children[$k];
					}
					$last = $this->children[$k];
				}
			}
			return (($child > $count) ? $last : null);
		} else {
			return $this->children[$child];
		}
	}
function &getChild($child, $ignore_text_comments = false) {
		if (!is_int($child)) {
			$child = $this->findChild($child);
		} elseif ($child < 0) {
			$child += $this->childCount($ignore_text_comments);
		}

		if ($ignore_text_comments) {
			$count = 0;
			$last = null;
			//foreach($this->children as &$c) {
			//	if (!$c->isTextOrComment()) {
			//		if ($count++ === $child) {
			//			return $c;
			//		}
			//		$last = $c;
			//	}
			//}

			foreach(array_keys($this->children) as $k) {
				if (!$this->children[$k]->isTextOrComment()) {
					if ($count++ === $child) {
						return $this->children[$k];
					}
					$last = $this->children[$k];
				}
			}
			return (($child > $count) ? $last : null);
		} else {
			return $this->children[$child];
		}
	}
function & getChild ( $ child , $ ignore_text_comments = false ) { if ( ! is_int ( $ child ) ) { $ child = $ this -> findChild ( $ child ) ; } elseif ( $ child < 0 ) { $ child += $ this -> childCount ( $ ignore_text_comments ) ; } if ( $ ignore_text_comments ) { $ count = 0 ; $ last = null ; //foreach($this->children as &$c) {
 //	if (!$c->isTextOrComment()) {
 //		if ($count++ === $child) {
 //			return $c;
 //		}
 //		$last = $c;
 //	}
 //}
 foreach ( array_keys ( $ this -> children ) as $ k ) { if ( ! $ this -> children [ $ k ] -> isTextOrComment ( ) ) { if ( $ count ++ === $ child ) { return $ this -> children [ $ k ] ; } $ last = $ this -> children [ $ k ] ; } } return ( ( $ child > $ count ) ? $ last : null ) ; } else { return $ this -> children [ $ child ] ; } }
Get childnode
@param int|DomNode $child Index, negative to count from end
@param bool $ignore_text_comments Ignore text/comments with index calculation
@return DomNode
Get childnode