Hallo! I have the following problem.I need to delete links and text in them. for example <a href=""> some text </ a> PHP: must remove it from the source. No only "some text", but all <a .. > ... </a> str_replace or maybe some ReGex Any Idea? Thanx!
try this: $pattern="/^(.*)<a.*>(.*)</a>(.*)$/iU"; $string="text with links"; while (preg_match($pattern,$string,$matches)) { $string=$matches[1].$matches[3]; # $matches[2] contains the linktext } print $string; #now without links Code (markup): a loop that match one link and rebuild the Text without that link...