src/Alg/HtmlParser.php
public function getTitle( $throwException = TRUE )
	{
		$nodes	= $this->document->getElementsByTagName( "title" );
		if( $nodes->length )
			return $nodes->item(0)->textContent;
		$tags	= $this->getMetaTags( TRUE );
		if( isset( $tags['dc.title'] ) )
			return $tags['dc.title'];
		if( $throwException )
			throw new RuntimeException( 'Neither Title Tag not Title Meta Tag found.' );
		return "";
	}
public function getTitle( $throwException = TRUE )
	{
		$nodes	= $this->document->getElementsByTagName( "title" );
		if( $nodes->length )
			return $nodes->item(0)->textContent;
		$tags	= $this->getMetaTags( TRUE );
		if( isset( $tags['dc.title'] ) )
			return $tags['dc.title'];
		if( $throwException )
			throw new RuntimeException( 'Neither Title Tag not Title Meta Tag found.' );
		return "";
	}
public function getTitle ( $ throwException = TRUE ) { $ nodes = $ this -> document -> getElementsByTagName ( "title" ) ; if ( $ nodes -> length ) return $ nodes -> item ( 0 ) -> textContent ; $ tags = $ this -> getMetaTags ( TRUE ) ; if ( isset ( $ tags [ 'dc.title' ] ) ) return $ tags [ 'dc.title' ] ; if ( $ throwException ) throw new RuntimeException ( 'Neither Title Tag not Title Meta Tag found.' ) ; return "" ; }
Returns Title of HTML Document or throws Exception.
@access		public
@param		bool			$throwException		Flag: throw Exception if not found, otherwise return empty String
@return		string
@throws		RuntimeException
Returns Title of HTML Document or throws Exception .