public function getContentsByAttr($attr, $attr_value) {
        $nodes = $this->_dom_x_path->query("//*[contains(@{$attr}, '{$attr_value}')]");
        
        $contents = [];
        
        foreach ($nodes as $node) {
            array_push($contents, $node->nodeValue);
        }
        
        return $contents;
    }
public function getContentsByAttr($attr, $attr_value) {
        $nodes = $this->_dom_x_path->query("//*[contains(@{$attr}, '{$attr_value}')]");
        
        $contents = [];
        
        foreach ($nodes as $node) {
            array_push($contents, $node->nodeValue);
        }
        
        return $contents;
    }
public function getContentsByAttr ( $ attr , $ attr_value ) { $ nodes = $ this -> _dom_x_path -> query ( "//*[contains(@{$attr}, '{$attr_value}')]" ) ; $ contents = [ ] ; foreach ( $ nodes as $ node ) { array_push ( $ contents , $ node -> nodeValue ) ; } return $ contents ; }
Get contents of an element by using attributes

@example    getContentsByAttr('class', 'thumbnail');

@param    string    $attr        Element attribute
@param    string    $attr_value    Value of element attribute

@return array
Get contents of an element by using attributes