[PHP] PHP正则表达式移除超链接文本 正则表达式移除a标签 →→→→→进入此内容的聊天室

来自 , 2020-07-31, 写在 PHP, 查看 151 次.
URL http://www.code666.cn/view/211ed78f
  1. //方法一
  2. preg_match_all('/<(a|a)[s]{0,1}[w=":()]*>[nrn]*(check user)[nrn]*</(a|a)>/i',$string,$matches);
  3.  
  4. //方法二
  5. preg_match_all('/<a[dd]*>check user</a>/i',$string,$matches);
  6. print_r($matches);
  7.  
  8. //方法三
  9. preg_match_all('/<a[^>]*>[^<]*</a>/i',$string,$matches);
  10. print_r($matches);
  11.  
  12. //方法四
  13. preg_match_all('/<a.+?>check user</a>/is',$str,$arr);
  14. print_r($arr);
  15.  
  16. //方法五
  17. preg_match_all('/<a.+?>check user</a>/is',$str,$arr);
  18. print_r($arr);

回复 "PHP正则表达式移除超链接文本 正则表达式移除a标签"

这儿你可以回复上面这条便签

captcha