Sunday 2 August 2009

PHP error: Illegal offset type for array

I was working on my parents in law house renting site in Spain, www.casacalida.es, this weekend trying to integrate some weather site data that is provided in XML format, when I ran into a PHP error that I couldn't figure out at first. I'll elaborate some more about the integration of the XML data into their CodeIgniter site later. The error seems to indicate that my multidimensional array keys were wrong somewhere, but I couldn't figure it out at first.

Some searching brought me to this post, that seemed to confirm my suspicion. Only I was using all string keys and not integers, but Maybe I could adopt some of the solution. So I added a string cast for my array key and hey presto my problem was solved.

No comments:

Post a Comment