I have a problem with preg_replace, my function have some bug and i dont know where. I need to remove from array every image that has source other than my main domain.
This is my function:
$aPatterns = array (
(...),
'#<img[^>]+src="(?!http://example.com/emoticon/(example|emot|name).gif)[^\s]+"[^>]+>#is',
(...));
$aReplecements = array(
(...),
'',
(...)
);
$contentOut = preg_replace($aPatterns,$aReplecements,$content);
If img tag is not closed or does not have double quotes sign at the end of src attribute function not working, no change to empty string.
I have no idea what is wrong in this expression, I hope, and I count on your help.
Regards,