I have a string that is:
<p><img src="../filemanager/image.png?1476187745382"/></p> some text ...
I would like to remove everything after a .png
or .jpg
when question mark occurs. The goal is to remove the timestamp added ?1476187745382
but not the "/></p>
some text ...
Keeping in mind that the timestamp, will change and the what comes after the the image >
will also be different.
I have looked at different solutions, but they all remove either the exact occurrence or everything after a certain character, which is not what I need to do.
This is what I have looked at:
- PHP remove characters after last occurrence of a character in a string
- Remove portion of a string after a certain character
Can someone point me to the right direction?