Re: [PHP] Re: testing for empty array

2002-11-26 Thread Morgan Hughes
On Tue, 26 Nov 2002, Kyle Gibson wrote:

> > I have an array $keywords, how do I test to see if it is empty?
> > $keywords == '' seems to throw out an error.
>
> Maybe...
>
> if(count($keywords) <= 0)
> {
>   //...
> }

  I use sizeof(), which apparently is an alias to count(), and it works
  fine, so count() should do the trick.

  if ( !sizeof($keywords) )
print "keywords is empty";

-- 
   Morgan Hughes
   C programmer and highly caffeinated mammal.
   [EMAIL PROTECTED]
   ICQ: 79293356



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




[PHP] Re: testing for empty array

2002-11-26 Thread Kyle Gibson
I have an array $keywords, how do I test to see if it is empty?  $keywords == '' seems to throw out an error.


Maybe...

if(count($keywords) <= 0)
{
	//...
}


--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


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