第32行extra.class.php中的非法字符串偏移'type'

时间:2014-10-05 15:32:18

标签: php wordpress

我的website出现以下错误;我是新手,WordPress无法跟踪问题。

Warning: Illegal string offset 'type' in /home/content/p3pnexwpnas03_data02/52/2259652/html/wp-content/themes/softwarefails/lib/php/extra.class.php on line 32

Warning: Illegal string offset 'type' in /home/content/p3pnexwpnas03_data02/52/2259652/html/wp-content/themes/softwarefails/lib/php/extra.class.php on line 32

extra.class.php

Code in fiddle

网站上出现错误,我无法上传错误后提供的任何图片。

An error occurred in the upload. Please try again later.

2 个答案:

答案 0 :(得分:0)

$inputs['type']如果在进行字符串比较之前存在测试,则可能不会先测试

答案 1 :(得分:0)

当您将字符串视为完整数组时,会导致此错误。例如

$fruit_counts = array('apples'=>2, 'oranges'=>5, 'pears'=>0);
echo $fruit_counts['oranges']; // echoes 5
$fruit_counts = "an unexpected string assignment";


echo $fruit_counts['oranges']; // causes illegal string offset error

看一看here