Re: [PHP-DEV] key_exists from php

2001-04-30 Thread Zeev Suraski
Why? It's only interesting if you're trying to understand the table schema from one of the arrays. The right way to do it (IMHO) would be by querying the result using the field fetching functions... Zeev At 13:12 30/4/2001, David Croft wrote: mysql_fetch_array (and probably others) return

Re: [PHP-DEV] key_exists from php

2001-04-30 Thread Jon Parise
On Sun, Apr 29, 2001 at 09:50:13PM -0400, David Croft wrote: There doesn't seem to be any way for a php script to determine whether a given key exists in an array. isset($arr['x']) fails when it exists but has a null value. I know there are ways around it like using foreach or array_keys but

[PHP-DEV] key_exists from php

2001-04-29 Thread David Croft
There doesn't seem to be any way for a php script to determine whether a given key exists in an array. isset($arr['x']) fails when it exists but has a null value. I know there are ways around it like using foreach or array_keys but these don't seem very efficient. I would like to add a function

Re: [PHP-DEV] key_exists from php

2001-04-29 Thread Andrei Zmievski
At 09:50 PM 4/29/01 -0400, David Croft wrote: There doesn't seem to be any way for a php script to determine whether a given key exists in an array. isset($arr['x']) fails when it exists but has a null value. I know there are ways around it like using foreach or array_keys but these don't seem

Re: [PHP-DEV] key_exists from php

2001-04-29 Thread David Croft
On Sun, 29 Apr 2001, Andrei Zmievski wrote: Key may be a number as well. -Andrei should that be separate e.g. index_exists? -- | /+\ \| | | David Croft Infotrek -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: [PHP-DEV] key_exists from php

2001-04-29 Thread Andrei Zmievski
At 10:00 PM 4/29/01 -0400, David Croft wrote: should that be separate e.g. index_exists? No, just have it take either string or number for a key. -Andrei -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL