• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 在一個字符串中查找另一個字符串

    發表于:2007-07-14來源:作者:點擊數: 標簽:
    html headtitle正則表達式/title/head body a href=./返回列表/abr 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=whe


    <html>
    <head><title>正則表達式</title></head>
    <body>
    <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>
    </html>

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>