Re: [PHP] If array()

2006-10-12 Thread Max Belushkin
John Taylor-Johnston wrote: How can I use "if" to see an array contains something? if (sizeof($array)) ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] If array()

2006-10-10 Thread Jochem Maas
Philipp Schwarz wrote: > Try this: > > if (is_array($array) && count($array)) { given that your not interested in the actual count of the array, only that is is not empty, save yourself a couple of CPU cycles and use empty() instead ... if (is_array($array) && !empty($array)) { foreach

Re: [PHP] If array()

2006-10-10 Thread Chris
John Taylor-Johnston wrote: How can I use "if" to see an array contains something? php.net/in_array -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] If array()

2006-10-10 Thread Philipp Schwarz
Try this: if (is_array($array) && count($array)) { ... } John Taylor-Johnston schrieb: How can I use "if" to see an array contains something? if ($array()) does not work, of course. John -- Mit freundlichen Grüßen Philipp Schwarz - comtr