How to remove a link from content in php?

前端 未结 7 834
悲哀的现实
悲哀的现实 2020-12-24 09:12

How can i remove the link and remain with the text?

text text text. 
7条回答
  •  -上瘾入骨i
    2020-12-24 10:11

    One more short solution without regexps:

    function remove_links($s){
        while(TRUE){
            @list($pre,$mid) = explode('',$mid,2);
            $s = $pre.$post;
            if (is_null($post))return $s;
        }
    }
    ?>
    

提交回复
热议问题