Illegal string offset when printing array values in PHP -
Many similar problems and solutions did not help me. I'm getting a strange error message WARNING: Invalid string offset in 'officeName' ... and var_dump of variable variable generates looks like this: The code that generates errors is: Then each , because one of these items There may be an array, but there can be something that is not. In such cases, it is always better than In addition,
Array (10) {[officeId "] => string (5)" 11237 "[" officeName "] => string (37)" Pro Office Inc. "}
foreach ($ objects $ key => $ value) {var_dump ($ value);}
$ value is an array what I am doing and how can I fix it, its What is wrong with?
var_dump () whole
$ objects array instead of each item , Because it is easy to find any errors.
invalid string offset error usually indicates that Ing do are trying to behave as an array and / or use of the keys, which are not present.
Comments
Post a Comment