php xpath get specifc element by attribute -
i'm trying element specific attribute ("data-image-id").
i got this:
$dom = new domdocument; @$dom->loadhtml($html); $xpath = new domxpath($dom); $links = $xpath->query('//div[@data-image-id]/@data-image-id'); die(var_dump($links)); but got following:
object(domnodelist)#3 (1) { ["length"]=> int(0) } i want elements attribute "image-data-id".
what doing wrong?
Comments
Post a Comment