« Return to Blog

Warning: Illegal offset type (PHP Array)

Author: Zeeshan Arshad     3507     10/18/2011

Estimated reading time: 0 minutes, 6 seconds

Problem: Warning: Illegal offset type when using object into array.
example; $array[] = $variable

Solution: use (string) $variable
example; $array[] = (string) $variable