php 正则如何实现替换html

  • 时间:
  • 来源:网络

   

php正则替换html的方法:首先创建一个PHP示例文件;然后通过正则表达式“preg_replace('/<[^>]*>/','',$string)”替换所有HTML标签即可。

推荐:《PHP视频教程》

PHP正则表达式替换所有HTML标签

preg_replace('/<[^>]*>/','',$string)