php在字符串中查找另一个字符串_php技巧
程序员文章站
2022-06-02 07:54:24
...
返回列表
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 "未找到!";
}
}
?>
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 "未找到!";
}
}
?>