<A href = "./"> back to list </a> <br>
<Form action = "<? Echo $ PHP_SELF;?> "Method =" post ">
In <input type = "text" name = "string" value = "<? Echo $ string;?> "> Search for <input type =" text "name =" query "value =" <? Echo $ query;?> "> <Br>
<Input type = "radio" name = "where" value = "" <? If (! Isset ($ where) or $ where = "") echo "checked" ;?>> The second string can be anywhere in the first string <br>
<Input type = "radio" name = "where" value = "^" <? If (isset ($ where) and $ where = "^") echo "checked" ;?>> The first string starts with the second string <br>
<Input type = "radio" name = "where" value = "$" <? If (isset ($ where) and $ where = "$") echo "checked" ;?>> The first string ends with the second string <br>
<Input type = "checkbox" name = "case" value = "case" <? If (isset ($ case) echo "checked" ;?>> Case Sensitive <br>
<Input type = "submit" value = "query">
</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 "found! ";
}
Else {
Echo "not found! ";
}
}
?>
</Body>