RE: isset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, April 16, 2007 5:35 pm, Tim Earl wrote:
> What about in the following context?
>
> $arr = array();
> If (!empty($arr)) { }
>
> This is where i have found it to be the most usefull...

If I'm already certain that it's an array, I just use 'count' personally.

'empty' takes a mixed data type, and could return TRUE for, say, 'foo'
even though you are expecting an array there.

I think it's a better practice to use the "right" weapon and use
count() on an array to see if it's empty or not.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux