I'm new to preg_replace
and have a problem.
I have this kind of text
$text = 'welcome to example.com site and this is image from example.com <img alt="image of example.com site" src="http://example.com/image.jpg"/> have a nice day!';
is it possible to make the result became
welcome to yyy.com site and this is image from yyy.com <img alt="image of yyy.com site" src="http://example.com/image.jpg"/> have a nice day!
like you see here, that on the plain text and alt example.com change to yyy.com BUT NOT on img source, the img src still goes to example.com (i want to keep it like that)
also if it possible make the replace is case insensitive so eXample.com examplE.com exAmPLe.com all replace to yyy.com
note: in some img, they have alt attribute but some of them doesn't have alt attribute