See the error log in PHP for some of these tips:
[27-aug-2011 22:26:12] PHP Warning:cannot use a scalar value as a array in/www/hx/enjoy.php in line 14
[27-aug-2011 22:26:18] PHP Warning:cannot use a scalar value as a array in/www/hx/enjoy.php in line 14
Check the source program, which is probably the following:
Copy Code code as follows:
$arr _hx = $mem->get (' HX ');
if (! $arr _hx) {
$arr _hx[' a '] = ' B ';
$mem->set (' HX ', $arr _HX);
}
It's basically clear that when $mem->get doesn't get a value, it returns false, at which point the $ARR_HX is False, the Boolean, and then it is used as an array, resulting in the hint. In fact, a variable does not define a situation, add a sentence before the assignment $arr _hx = array () to solve the problem.
Looked up, like the following description:
Reference
What you need to be aware of is type conversions:
If a variable name (such as a) has been defined as a non-array type, such as Integer, then a can be converted to floating point, string (or even object type), but not an array, that is, a[0]=1; it is wrong, PHP will quote such a warning " Cannot use a scalar value as a array ". Even if a is defined as a one-dimensional array, it cannot be converted to a high-dimensional array.