Imagine I have a string, $bodytext, which consists of ->
Code: Select all
<p>Hello world
<br>hello world
<br><img src="someimage.jpg">
<br>hello world
<br><img src="anotherimage.jpg">
<br>hello world
<br><img src="andanotherimage.jpg">So I want to be left with the string consisting of ->
Code: Select all
<p>Hello world
<br>hello world
<br>
<br>hello world
<br>
<br>hello world
<br>Code: Select all
array(int) {
ї"1"]=>
string(int) "<img src="someimage.jpg">"
ї"2"]=>
string(int) "<img src="anotherimage.jpg">"
ї"3"]=>
string(int) "<img src="andanotherimage.jpg">"
}I've played around using strpos(), substr(), strstr() and all sorts, but I can't make anything do exactly what I want to.
I hope I have explained well enough.
Any help or pointers to get me going in the correct direction would be really great, thanks