$rss = "<![CDATA[
test0.<br/>test1.<br/>test2.<a href='test'><img src='test'/></a>
]]>"
$rss[$i] = preg_replace_callback ("|(CDATA\[)(.+)(\]\])|imU",
function ($matches)
{
$t1 = strip_tags($matches[2], "<img>");
$t2 = preg_replace ("|(\<img src=')(.+)('\s*?/\>)|imU", "$2", $t1);
$t3 = $matches[1] . $t2 . $matches[3];
return $t3;
}
, $rss[$i]);
</br>
заменять на \n