I am using Simple HTML DOM to get content from a website. However some of the images do not display because they are set as backdroung images from an external so I have called this in also.
However the image dose not have the full path.
<style>
div.spriteImgSmall { background: url(/images/css_sprites/film_sprites/smallimages_sprite.jpg); }
div.spriteImgSmall_17826 { background-position: -0px -0px; width: 86px; height: 64px; }
</style>
There are no head or body tags as this is part of a facebook app. How could I use Simple HTML DOM to add on the base url to the path?
DOM deals with structured HTML, however what you've got there is CSS, which for DOM is just unstructured text. So probably your best approach would be:
(string)$dom->stylepreg_match(), looking for url(blah-blah) If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With