$str ="http://www.httproot.com我的网址";
$str1 ="支付宝的网址是HTTPS://www.alipay.com你记住了吗";//https支持,大写支持
$str2 ="http://news.baidu.com百度新闻,过滤url链接";
function removeLinks($str){
if(empty($str)){return '';}
$str =preg_replace('/(http)(.)*([a-z0-9\-\.\_])+/i','',$str);
$str =preg_replace('/(www)(.)*([a-z0-9\-\.\_])+/i','',$str);
return $str;
}
echo removeLinks($str).'';
echo removeLinks($str1).'';
echo removeLinks($str2).'';