Home > php教程 > php手册 > 正则表达式例子在一个字符串中查找另一个字符串

正则表达式例子在一个字符串中查找另一个字符串

WBOY
Release: 2016-06-13 10:26:41
Original
1079 people have browsed it



正则表达式

返回列表


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 "未找到!";
}
}
?>

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template