/ Published in: PHP
Affects <A> tags for links starting with $link
Example: LinkReplacer ($text, 'http://www.snipplr.com') affects to
<a href="http://www.snipplr.com">Snipplr</a>
and <a href="http://www.snipplr.com/blog">Snipplr Blog</a>
Example: LinkReplacer ($text, 'http://www.snipplr.com') affects to
<a href="http://www.snipplr.com">Snipplr</a>
and <a href="http://www.snipplr.com/blog">Snipplr Blog</a>
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function LinkReplacer($text, $link, $new_text) { $regexp = '/<a [^<]*href=["|\']?'.$quoted_link.'["|\']?[^>]*>.*<\\/a>/ui'; return $text; }