Revision: 12802
Updated Code
at March 30, 2009 23:26 by kossmoss
Updated Code
function LinkReplacer($text, $link, $new_text)
{
$quoted_link = preg_quote($link,'/\'');
$regexp = '/<a [^<]*href=["|\']?'.$quoted_link.'["|\']?[^>]*>.*<\\/a>/ui';
$text=preg_replace($regexp, $new_text, $text);
return $text;
}
Revision: 12801
Updated Code
at March 30, 2009 17:20 by kossmoss
Updated Code
function LinkReplacer($text, $link)
{
$quoted_link = preg_quote($link,'/\'');
$regexp = '/<a [^<]*href=["|\']?'.$quoted_link.'["|\']?[^>]*>.*<\\/a>/ui';
$text=preg_replace($regexp,"REPLACE TEXT",$text);
return $text;
}
Revision: 12800
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at March 29, 2009 10:29 by kossmoss
Initial Code
$text=preg_replace('/<a [^<]*href=["|\']?([^ "\']*)["|\']?[^>].*>([^<]*)<\/a>/ui',' <a href="/">ЗдеÑÑŒ была Ð¾Ñ€Ð¸Ð³Ð¸Ð½Ð°Ð»ÑŒÐ½Ð°Ñ ÑÑылка</a> ',$text);
Initial URL
Initial Description
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>
Initial Title
Replace specified link tag in text
Initial Tags
url, replace
Initial Language
PHP