警告:为每个()提供的参数无效

时间:2016-04-12 12:48:40

标签: php

在我的网站上为第113行获取此错误,不确定为什么会发生这种情况或需要采取哪些措施来纠正代码。请参阅下面的代码段。

    // Return the CDN object by name.
    // If a section is defined. Only returns the object if it exists in that section
    // if "Section" is not defined; returns an object if it exists in any section.
    // Returns FALSE if not found.
    public function CDN($name='',$section=''){
        if (empty($name)) return FALSE;
        else
        foreach ($this->CDNS as $CDN){
            if (!empty($section)) {
                if (stripos($name, $CDN->Name()) !== FALSE && ($CDN->Position() == $section)) return $CDN;
            }
            else
                if (stripos($name, $CDN->Name()) !== FALSE) return $CDN;

        }
        return FALSE;
    }

1 个答案:

答案 0 :(得分:-1)

似乎$this->CDNS是空的。如下所示:

public function CDN($name='',$section=''){
    if (empty($name)) return FALSE;
    else
    {
     if(!empty($this->CDNS))
     {
    foreach ($this->CDNS as $CDN){
        if (!empty($section)) {
            if (stripos($name, $CDN->Name()) !== FALSE && ($CDN->Position() == $section)) return $CDN;
        }
        else
         if (stripos($name, $CDN->Name()) !== FALSE) return $CDN;

    }
    return FALSE;
   }
}
}