Hello. There is a script that finds the necessary lines, after it must find each matching line in the text, and if found, replace it with another text:
Sketched this code:
foreach ($a_links2 as & $value2) { echo $value2->src; //строки которые нужно заменить $text = str_replace($value2->src, "КАРТИНКА", $article['content']); } echo $text; The result is that it replaces only the last line found.