I have the results from a database that contains images and text. I would like to remove the first image.
Example:
$string = 'This is some text and images
<img src="http://linktoimage" border="0">,
more text and <img src="http://linktoanotherimage"> and so on';
I would like to remove the first image, it is not always the same url.
Thanks for any help.
The above should return
Assuming you know it’ll be prefixed by spaces and a line break, and suffixed by a comma and line break (and you want to remove these, too), you can do
Which will give you