function removeLink($str){ $regex = '//isU'; preg_match_all($regex,$str,$result); foreach($result[0] as $rs) { $regex = '/(.*)<\/a>/isU'; $text = preg_replace($regex,'$2',$rs); $str = str_replace($rs,$text,$str); } return $str;}