Keith Watanabe * NET 2.0

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.

AddThis Social Bookmark Button Sphere: Related Content

Trackbacks: (Trackback URL)

No Comments Posted Yet
December [January] February
Sun Mon Tue Wed Thu Fri Sat
28 29 30 31 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31