SimpleHtmlSaxParser::parse PHP Method

parse() public method

Runs the content through the lexer which should call back to the acceptors.
public parse ( string $raw ) : boolean
$raw string Page text to parse.
return boolean False if parse error.
    public function parse($raw)
    {
        return $this->lexer->parse($raw);
    }

Usage Example

 /**
  *    Reads the raw content and send events
  *    into the page to be built.
  *    @param $response SimpleHttpResponse  Fetched response.
  *    @return SimplePage                   Newly parsed page.
  *    @access public
  */
 function parse($response)
 {
     $this->tags = array();
     $this->page = $this->createPage($response);
     $parser = new SimpleHtmlSaxParser($this);
     $parser->parse($response->getContent());
     $this->acceptPageEnd();
     $page = $this->page;
     $this->free();
     return $page;
 }
All Usage Examples Of SimpleHtmlSaxParser::parse