get新技能是需要付出行动的,即使看得再多也还是要动手试一试。今天图老师小编跟大家分享的是在一个字符串中查找另一个字符串,一起来学习了解下吧!
【 tulaoshi.com - Web开发 】
htmlheadtitle正则表达式/title/headbodya href="./"返回列表/abrform action="?echo $PHP_SELF;?" method="post"在input type="text" name="string" value="?echo $string;?"中查找input type="text" name="query" value="?echo $query;?"brinput type="radio" name="where" value="" ?if(!isset($where) or $where=="") echo "checked";?第二个字符串可以在第一个字符串的任何位置brinput type="radio" name="where" value="^" ?if(isset($where) and $where=="^") echo "checked";?第一个字符串以第二个字符串开始brinput type="radio" name="where" value="$" ?if(isset($where) and $where=="$") echo "checked";?第一个字符串以第二个字符串结束brinput type="checkbox" name="case" value="case" ?if(isset($case)) echo "checked";?区分大小写brinput type="submit" value="查询"/form?if(isset($string) and isset($query) and $string"" and $query""){  if(isset($case)){    $func = "ereg";  }  else{    $func = "eregi";  }  switch($where){    case "^":      $query = "^" . $query;      break;    case "$":      $query .= "$";      break;  }  eval("$found = $func("$query","$string");");  if($found){    echo "找到!";  }  else{    echo "未找到!";  }}?/body/html(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/webkaifa/)
                        来源:http://www.tulaoshi.com/n/20160219/1612821.html
看过《在一个字符串中查找另一个字符串》的人还看了以下文章 更多>>