Php 警告:strpos()[function.strpos]:第70行的分隔符为空

Php 警告:strpos()[function.strpos]:第70行的分隔符为空,php,warnings,delimiter,strpos,Php,Warnings,Delimiter,Strpos,我得到一个错误: 警告:strpos[function.strpos]:第70行为空分隔符 有什么问题?以下是守则的相关部分: if (strpos($this->request->server['HTTP_USER_AGENT'], trim($rt)) !== false) { 我不是一个编码专家,所以我不能在这里真正应用答案。一点帮助就能使我走得更远。以下是全部条目: ****$status=true if (isset($this->request->s

我得到一个错误:

警告:strpos[function.strpos]:第70行为空分隔符

有什么问题?以下是守则的相关部分:

if (strpos($this->request->server['HTTP_USER_AGENT'], trim($rt)) !== false) {
我不是一个编码专家,所以我不能在这里真正应用答案。一点帮助就能使我走得更远。以下是全部条目:

****$status=true

    if (isset($this->request->server['HTTP_USER_AGENT'])) {
        $robots = explode("\n", trim($this->config->get('config_robots')));
        foreach ($robots as $robot) {
            if (strpos($this->request->server['HTTP_USER_AGENT'], trim($rt)) !== false) {
                $status = false;
                break;
            }
        }
    }****

在使用print_r函数或var_dump函数进入while循环之前,尝试“转储”$robots数组,如下所示:

$robots = explode("\n", trim($this->config->get('config_robots')));
print_r($robots);
//OR var_dump($robots); 
foreach ($robots as $robot) {
    //blah blah blah
}

这应该是有帮助的:。祝你好运

@DanielG.Gabori很高兴能帮忙。