php Warning:strstr()[function.strstr]:Empty delimiter
Warning: strstr() [function.strstr]: Empty delimiter,非常奇怪,难道php函数strstr的某个参数出问题了?,于是写了个测试的例子:
- <?php
- $text=”asdfghjklqwertyuiopzxcvbnm”;
- //$key=”g”;
- //根据php错误提示Empty delimiter,判断应该不会是$text的值出问题,所以故意注释了key值
- if(strstr($text, $key)){
- echo “found it”;
- }else{
- echo “not found”;
- }
- ?>
strstr()竟然不报错,于是想到$key值可能会是空串”",姑且一试,果然strstr($text,”")时,提示出错Warning: strstr() [function.strstr]: Empty delimiter