Posted 2014-05-27Updated 2014-05-27a few seconds read (About 27 words) visits正则去掉<a>标签并保留标签内容话不多说,直接上例子: 1234$str = "<a href=http://www.ldsun.com/ target="blank"> www.ldsun.com </a>"; $str1 = preg_replace("/<a[^>]*>/","", $str); $str2 = preg_replace("/<\/a>/","", $str1); echo $str2; 正则去掉<a>标签并保留标签内容https://ldsun.com/2014/05/27/正则去掉-a-标签并保留标签内容/AuthorLudisPosted on2014-05-27Updated on2014-05-27Licensed under