给定一个这样形成的字符串:
hello Rose <tag> Micheal </tag> and <tag> July </tag> John.
我想删除 <tag>
之间的所有内容和 </tag>
并有输出:
hello Rose and John.
我该怎么做?
最佳答案
我猜你可以使用:
$new_html = preg_replace('%<tag>.*?</tag> ?%si', '', $old_html);
关于php - 如何从两个标签中删除多个子字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43516138/