$str ="https://www.51dev.com开发网址";
$str1 ="支付宝的网址是HTTPS://www.alipay.com你记住了吗";//https支持,大写支持
$str2 ="http://news.baidu.com百度新闻,过滤url链接";
function removeLinks($str){
if(empty($str))return '';
$str =preg_replace('/http:[/]{2}[a-z]+[.]{1}[a-zd-]+[.]{1}[a-zd]*[/]*[A-Za-zd]*[/]*[A-Za-zd]*/','',$str);
return $str;
}
echo removeLinks($str).'';
echo removeLinks($str1).'';
echo removeLinks($str2).'';