I have an email popping script that needs to remove embedded images.
The images have "cid" in the source attribute like this one.
<img width="83" height="95" src=
"cid:image002.jpg@01CAC038.74744940" align="left" />
This is what I have so far which seems to work. Any way I can approve upon this? Thanks in advance.
$regEx = '/<img[\w\W]+src=[\r\n]?["\']cid[\w\W]+\s(\/>|>)/';
$img = '<img width="83" height="95" src=
"cid:image002.jpg@01CAC038.74744940" align="left" />';
$img = preg_replace($regEx, '', $img);