Re: [PHP] Mystery foreach error

[email protected] (Angela Barone)
Newsgroups php.general
Message-ID <[email protected]>
On Mar 13, 2013, at 5:02 PM, David Harkness wrote:
> isset() will return false for an array key 'foo' mapped to a null value whereas array_key_exists() will return true. The latter asks "Is this key in the array?" whereas isset() adds "and is its value not null?" While isset() is every-so-slightly faster, this should not be a concern. Use whichever makes sense for the context here.

Hi David,

	Thank you for the explanation.  It's nice to know the difference between them.  Since they are equivalent for my use, I went with array_key_exists, simply because it makes more sense to me in English. ;)

	Thanks again to everyone.  I got it to work _and_ there are no more errors!!!

Angela
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.