This function makes links unclickable, read the comments:
<?php
function strip_urls($text, $repPat)
{
if(!$repPat){
$repPat = "text [url]";
}
$aimpstr = 'PHP_STRIP_URLS_FUNCTION_BY_REAL-PHP-GEEK';
//change $aimpstr to anything you want.
$impstr = md5($aimpstr);
$text = str_replace('</a>', '</a>' . $impstr, $text);
$text = explode($impstr, $text);
$n = 0;
$texta = array();
$repPat = str_ireplace(array('text', 'url'), array('\\4', '\\2'), $repPat);
foreach ($text as $text) {
$texta[$n] = ereg_replace("<a(.*)href=\"(.*)\"(.*)>(.*)</a>", $repPat, $text);
$n++;
}
$textb = implode("</a>", $texta);
return $textb;
}
//EXAMPLES:
$string_of_text = '<a href="http://www.php.net/">PHP</a> rocks. <a href="http://www.apache.org/">Apache</a> also!';
echo strip_urls($string_of_text, "text");
echo strip_urls($string_of_text, "url");
echo strip_urls($string_of_text, "text [url]");
echo strip_urls($string_of_text, NULL);
?>