strip_tags() … replace tags by space rather than deleting them

前端 未结 10 967
日久生厌
日久生厌 2020-12-08 06:36

Do you know how to replace html tags with a space character using php?

If I display

strip_tags(\'

Foo

bar\');

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-08 07:28

    First do a str_replace

    $string = '

    Foo

    bar' strip_tags(str_replace('', ' ',$string));

提交回复
热议问题