See some of these hints in the PHP error log:
[27-aug-2011 22:26:12] PHP Warning:cannot use a scalar value as an array in/www/hx/enjoy.php on line 14
[27-aug-2011 22:26:18] PHP Warning:cannot use a scalar value as an array in/www/hx/enjoy.php on line 14
Check the source program, probably like this:
Copy the Code code as follows:
$arr _hx = $mem->get (' HX ');
if (! $arr _hx) {
$arr _hx[' a '] = ' B ';
$mem->set (' HX ', $arr _HX);
}
Basically understand that when the $mem->get does not get the value of the return is false, at this time $arr_hx is False, Boolean, and then use it as an array, resulting in such a hint. In fact, a variable is not defined in a situation, before the assignment to add a sentence $arr _hx = array () to solve the problem.
Check it out, like the following note:
Reference
It is important to note the conversion of the type:
If a variable name (such as a) has been defined as a non-array type, such as an integer, then a can be converted to floating point, string (or even object type), but not an array, or a[0]=1, which is wrong, and PHP will report such a warning " Cannot use a scalar value as an array ". Even if a is defined as a one-dimensional array, it cannot be converted to a high-dimensional array.
The above describes the scalar PHP warning cannot use a scalar value as an array solution, including the scalar aspects of the content, I hope to be interested in PHP tutorial friends helpful.