Home > Backend Development > PHP Tutorial > Regular expression example to find another string in a string_PHP tutorial

Regular expression example to find another string in a string_PHP tutorial

WBOY
Release: 2016-07-13 17:26:39
Original
892 people have browsed it



Regular expression

Return list


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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531936.htmlTechArticleRegular expression returns list if(isset($string) and isset($query) and $string "" and $query ""){ if(isset($case)){ $func = "ereg"; } else{ $func = "eregi"; } switch($where){ case "^...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template