2
I have the following structure:
<div class="xGh" style="background-image: url('name_file.jpg');"></div>
Where I need to capture:
name_file.jpg
I tried to use the solution presented in this reply, but it is not working, it presents a syntax error:
See the test with the error in Ideone
$img = $xpath->query(substring-before(substring-after(//div[@class='xGh']/@style, "background-image: url('"), "')"));
echo $img->item($i)->nodeValue."<br/>";
I know how to do with regex
, but wanted to use xpath
, it is possible?
See if you can help me man https://answall.com/questions/251666/howto iterate to get all the results:)
– MagicHat