PHP Associative Arrays and Numbers as Keys
By: Keith Watanabe
Published On: 11-14-2007
I remember having this problem before and I spent a little time struggling trying to figure out this issue. The thing is that if you want to use integers as keys for an associative array in PHP, you need to quote them. That is, when you're generating a new key. Otherwise, you'll receive a warning:
Warning: Illegal offset type
It's very annoying.
Post Comment
Trackbacks: (Trackback URL)
No Comments Posted Yet