色尼玛亚洲综合影院,亚洲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在字符串中查找另一個字符串,轉載需保留來源!

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

主站蜘蛛池模板: 时尚| 永城市| 沙河市| 芜湖县| 贵南县| 芜湖县| 扎囊县| 临夏县| 临汾市| 漠河县| 廉江市| 益阳市| 贵港市| 嘉兴市| 阿克陶县| 休宁县| 彰化市| 宜黄县| 乳源| 海阳市| 四会市| 白城市| 曲阳县| 封开县| 新昌县| 建阳市| 曲阳县| 峨边| 康定县| 伊宁市| 宜兰市| 清镇市| 西宁市| 靖远县| 合阳县| 东安县| 梨树县| 辽阳县| 志丹县| 崇信县| 阿城市|