PHP removing html tags from string

后端 未结 6 1841
小鲜肉
小鲜肉 2020-12-02 02:06

I have string:

Vers­lo cent­rai Lie­tu­vos ne­kil­no­ja­mo­jo turto plėt­ros aso­cia­ci­jos kon­kur­se ...

6条回答
  •  一个人的身影
    2020-12-02 02:36

    Since the HTML is poorly formated you probably need to either write your own regexp to remove tags or clean up the HTML before trying to remove tags.

    You could try this to remove everything that "looks like" a tag:

    $str = preg_replace("/<.*?>/", " ", $str);
    

提交回复
热议问题