PHPHtmlParser\Dom::firstChild PHP Метод

firstChild() публичный Метод

Simple wrapper function that returns the first child.
public firstChild ( ) : AbstractNode
Результат PHPHtmlParser\Dom\AbstractNode
    public function firstChild()
    {
        $this->isLoaded();
        return $this->root->firstChild();
    }

Usage Example

Пример #1
0
 public function testFirstChild()
 {
     $dom = new Dom();
     $dom->load('<div class="all"><p>Hey bro, <a href="google.com" data-quote="\\"">click here</a></div><br />');
     $this->assertEquals('<div class="all"><p>Hey bro, <a href="google.com" data-quote="\\"">click here</a></p></div>', $dom->firstChild()->outerHtml);
 }