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

Reply via email to