php Warning:strstr()[function.strstr]:Empty delimiter_PHP教程

WBOY
Release: 2016-07-13 10:57:15
Original
1362 people have browsed it

Today, when using the strstr function in php, it prompted Warning: strstr()[function.strstr]: Empty delimiter is wrong. Later, after repeated searches, I found a solution. Students in need can refer to it.

Warning: strstr() [function.strstr]: Empty delimiter

Very strange, is there something wrong with one of the parameters of the php function strstr?

So I wrote a test example

$text=”asdfghjklqwertyuiopzxcvbnm”;
//$key=”g”;
The code is as follows
 代码如下 复制代码

$text=”asdfghjklqwertyuiopzxcvbnm”;
//$key=”g”;

//根据php错误提示Empty delimiter,判断应该不会是$text的值出问题,所以故意注释了key值

if(strstr($text, $key)){
echo “found it”;
}else{
echo “not found”;
}

?>

Copy code

//According to the PHP error prompt Empty delimiter, it was judged that there should not be a problem with the value of $text, so the key value was deliberately annotated

if(strstr($text, $key)){
echo “found it”;
}else{
echo “not found”;
}

Related labels:
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