How to remove text between tags in php?

前端 未结 6 934
时光取名叫无心
时光取名叫无心 2020-12-06 00:56

Despite using PHP for years, I\'ve never really learnt how to use expressions to truncate strings properly... which is now biting me in the backside!

Can anyone prov

6条回答
  •  自闭症患者
    2020-12-06 01:12

    You could use substring in combination with stringpos, eventhough this is not a very nice approach.

    Check: PHP Manual - String functions

    Another way would be to write a regular expression to match your criteria. But in order to get your problem solved quickly the string functions will do...

    EDIT: I underestimated the audience. ;) Go ahead with the regexes... ^^

提交回复
热议问题