色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php在字符串中查找另一個字符串

<a href="./">返回列表</a><br>
<form action="<?echo $php_SELF;?>" method="post">
在<input type="text" name="string" value="<?echo $string;?>">中查找<input type="text" name="query" value="<?echo $query;?>"><br>
<input type="radio" name="where" value="" <?if(!isset($where) or $where=="") echo "checked";?>>第二個字符串可以在第一個字符串的任何位置<br>
<input type="radio" name="where" value="^" <?if(isset($where) and $where=="^") echo "checked";?>>第一個字符串以第二個字符串開始<br>
<input type="radio" name="where" value="$" <?if(isset($where) and $where=="$") echo "checked";?>>第一個字符串以第二個字符串結束<br>
<input type="checkbox" name="case" value="case" <?if(isset($case)) echo "checked";?>>區分大小寫<br>
<input 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>

php技術php在字符串中查找另一個字符串,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 林州市| 长宁区| 屯昌县| 突泉县| 察雅县| 古丈县| 贵南县| 玉溪市| 松江区| 肃南| 黄龙县| 增城市| 右玉县| 张掖市| 高要市| 翁牛特旗| 江安县| 天气| 美姑县| 阿克苏市| 平阴县| 沅江市| 永宁县| 米泉市| 黑山县| 隆尧县| 洛阳市| 东乡县| 乐业县| 澄城县| 马关县| 若尔盖县| 周至县| 新丰县| 肇东市| 乌什县| 宣城市| 得荣县| 广宗县| 诸暨市| 云浮市|