src/Alg/HtmlParser.php
public function getTagById( $id, $throwException = TRUE )
	{
		$xpath	= new DomXPath( $this->document );
		$query	= "//*[@id = '$id']";
		$tags	= $this->getTagsByXPath( $query );
		if( $tags )
			return $tags[0];
		if( $throwException )
			throw new RuntimeException( 'No Tag with ID "'.$id.'" found.' );
		return NULL;
	}
public function getTagById( $id, $throwException = TRUE )
	{
		$xpath	= new DomXPath( $this->document );
		$query	= "//*[@id = '$id']";
		$tags	= $this->getTagsByXPath( $query );
		if( $tags )
			return $tags[0];
		if( $throwException )
			throw new RuntimeException( 'No Tag with ID "'.$id.'" found.' );
		return NULL;
	}
public function getTagById ( $ id , $ throwException = TRUE ) { $ xpath = new DomXPath ( $ this -> document ) ; $ query = "//*[@id = '$id']" ; $ tags = $ this -> getTagsByXPath ( $ query ) ; if ( $ tags ) return $ tags [ 0 ] ; if ( $ throwException ) throw new RuntimeException ( 'No Tag with ID "' . $ id . '" found.' ) ; return NULL ; }
Returns HTML Tag by its ID or throws Exception.
@access		public
@param		string			$id					ID of Tag to return
@param		bool			$throwException		Flag: throw Exception if not found, otherwise return empty String
@return		DOMElement
Returns HTML Tag by its ID or throws Exception .