$author=$forum['lastpost']['author']; //获取a标签字符串 $match='/<a href="[^"]*"[^>]*>(.*)<\/a>/';//a标签正则匹配 preg_match_all($match,$author,$arr); //开始匹配 $auth=$arr['1']['0'];//得到自己想要的数据 echo substr_replace("$auth",'****',3,4); //进行替换
PHP 正则匹配a标签间的内容
最新推荐文章于 2023-08-18 12:46:09 发布