未定义的偏移量/索引PHP

时间:2016-10-24 17:56:15

标签: php undefined

LOG:

PHP Notice:  Undefined offset: 1
PHP Notice:  Undefined offset: 1
PHP Notice:  Undefined offset: 1
PHP Notice:  Undefined index:
PHP Notice:  Undefined offset:

CODE:

function getValueID($type) {
            $ids = $this->cfg['table']['columns']['mc_ID'];
            if ( STRLEN($ids[1]) != 1 ) {
                return $this->item[$ids[$type]];
            } else {
                $_ids = explode($ids[1], $this->item[$ids[0]]);
                return $_ids[$type];
            }
        }
        function pathImg() {
            return $this->cfg['path']['img'][0] . $this->getValueID(0) . ($this->getValueID(1) ? $this->cfg['path']['img'][1] . $this->getValueID(1) : '') . $this->cfg['path']['img'][2];
        }

未定义的偏移量:

中的1
if ( STRLEN($ids[1]) != 1 ) {

未定义的偏移量:

中的1
if ( STRLEN($ids[1]) != 1 ) {

未定义的索引:在

return $this->item[$ids[$type]];

未定义的偏移量:

中的2
return $this->cfg['path']['img'][0] . $this->getValueID(0) . ($this->getValueID(1) ? $this->cfg['path']['img'][1] . $this->getValueID(1) : '') . $this->cfg['path']['img'][2];

0 个答案:

没有答案