Answer the question
In order to leave comments, you need to log in
How to remove extra links in a line?
Hello.
There is a line of text:
<p>алвоп <a href="#"></a> и <a href="#"><img src="http://" alt=""></a></p>
preg_replace('#<a.*>.*</a>#USi', '', $text)
Answer the question
In order to leave comments, you need to log in
Long code, but try to remove <a.*>
it </a>
separately.
$text = preg_replace('#<a.*>#USi', '', $text);
$text = preg_replace('#</a>#USi', '', $text);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question