I need some help with preg_replace. At my website I need to delete some things I don’t need.
Here is an example:
THIS IS WHAT I NEED
Ok, all I need from this string is: the text inside caption="THIS TEXT",
every thing else I need to be deleted, I have used Google and tried some examples but nothing.
Maybe I need to use another function, but from what I have read on the internet this should replace .
Please help me, it’s very important.
Thank you.
EDIT:
The code has some other things that i have forgot.
<a href="http://localhost/111baneease1.jpg">
<img class="size-full wp-image-100951" title="zjarr_banese1" src="http://localhost/111baneease1.jpg" alt="eeeeeeeeeeeeeeeee" width="448" height="308" />
</a>
eaaaaaaaaaaaaaaaaaa
So i need to get the CAPTION text and delete every thing in
but not
<a href="http://localhost/111baneease1.jpg">
<img class="size-full wp-image-100951" title="zjarr_banese1" src="http://localhost/111baneease1.jpg" alt="eeeeeeeeeeeeeeeee" width="448" height="308" />
</a>
also want delete
eaaaaaaaaaaaaaaaaaa
too.
This regex :
will output :
when applied to :
Updated answer based on your updated question :
The above regex applied to :
Will output :
I am not sure if this is exactly what you wanted. Of course you can use the regex to match and do whatever you want with groups $2 and $3…