for example i have a text like
<p>
Quis vel accusantium libero. Suscipit officiis culpa
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">
libero quia ad.
</p>
and i want to check if the string has any data:image
then truncate only this part so max char of 50, so the results become
<p>
Quis vel accusantium libero. Suscipit officiis culpa
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH...">
libero quia ad.
</p>
am not sure how exactly to achieve that with preg_replace
and "data:image.+?"
pattern