On Mon, Oct 25, 2010 at 12:25 PM, Dan Cech <dc...@phpwerx.net> wrote:
> On 10/25/2010 12:22 PM, David Mintz wrote: > >> Anybody know of any reason not to save a little typing with >> >> empty($array['foo']) >> > > They're different comparisons, array_key_exists will return true if there > is an element with that key *even if it is null or some other empty() value* > (and the logic is reversed, you need !empty()), isset($array['foo']) is > closer but will return false if the value is null. > > http://us3.php.net/manual/en/types.comparisons.php > > Ah yes, of course. I might have added that for what I have in mind, if $array['foo'] existed and were any empty() value, that would serve my purposes just as well. Here's a deep insight: array_key_exists is nice for finding out if the array key exists. Thanks. -- David Mintz http://davidmintz.org/ It ain't over: http://www.healthcare-now.org/
_______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation