[PHP] 正则表达式进行字符串搜索 →→→→→进入此内容的聊天室

来自 , 2019-12-06, 写在 PHP, 查看 110 次.
URL http://www.code666.cn/view/766e428d
  1. <?php
  2. $string_to_search = "yuncode.net";
  3. $regex = "/tor/";
  4. $num_matches = preg_match($regex, $string_to_search);
  5.  
  6. if ($num_matches > 0) {
  7.   echo "Found a match!";
  8. } else {
  9.   echo "No match. Sorry.";
  10. }
  11. ?>
  12.  
  13.  

回复 "正则表达式进行字符串搜索"

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

captcha