PHPHtmlParser\Dom::getElementsByTag PHP Method

getElementsByTag() public method

Simple wrapper function that returns all elements by tag name.
public getElementsByTag ( string $name ) : array
$name string
return array
    public function getElementsByTag($name)
    {
        $this->isLoaded();
        return $this->find($name);
    }

Usage Example

Esempio n. 1
0
 public function testMultipleSingleQuotes()
 {
     $dom = new Dom();
     $dom->load("<a title='Ain't this the best' href=\"http://www.example.com\">Hello</a>");
     $this->assertEquals("Ain't this the best", $dom->getElementsByTag('a')[0]->title);
 }
All Usage Examples Of PHPHtmlParser\Dom::getElementsByTag