I have a sample code html:
$text = '<img src="abc.jpg" alt="abc" /> abc def ghi abc xyz';
echo str_replace('abc', 'has replace', $text);
when i echo result is in tag <img/> has replace ‘abc‘ to ‘has replace‘ => error
How to when run result is:
<img src="abc.jpg" alt="abc" /> has replace def ghi has replace xyz
I have a ideas:
And then you can replace:
Result now is:
$text = ’74d3ae3af91872413da1db45d88ddd4a abc def ghi abc xyz’; // img has been md5
Final you can:
Hope you will successful