How to use php preg_replace
and regular expression
to remove all the hyperlink which contain <a href="#
. Here is what I write, but it doesn't work
$newlink = preg_replace('/^<a href="#(.*)" (?:.*?)>(.*)<\/a>/is', '', $link);
I want replace these links which as aa anchor mark
<a href="#part1">go to part1</a>
<a href="#part2">go to part2</a>
<a href="#part3">go to part3</a>
to empty value.