Home  >  Article  >  Backend Development  >  php Warning:strstr()[function.strstr]:Empty delimiter_PHP教程

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

WBOY
WBOYOriginal
2016-07-13 10:57:151361browse

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”;
}

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