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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 17:26:39912browse



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 "^...
Statement:
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