Home > Backend Development > PHP Tutorial > php finds another string in a string_PHP tutorial

php finds another string in a string_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 15:49:11
Original
837 people have browsed it

Return to list


Find ">

>The second string can be anywhere in the first string

>The first string starts with the second string> ;The first string ends with the second string

>Case sensitive



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; func("$query","$string");");
 if($found){
 echo "Found! ";
 }
 else{
 echo "Not found! ";
 }
}
?>


http://www.bkjia.com/PHPjc/319564.html

truehttp: //www.bkjia.com/PHPjc/319564.htmlTechArticlea href="./"Return to list/abr form action="?echo $PHP_SELF;?" method= "post" finds input type="text" name="query" value="?e...
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template