RE: [PHP-DB] checking for empty array from a form field? grrrrrrr rrrr!
| From: | Hutchins, Richard | Date: | Wed, 05 Feb 2003 21:03:07 +0000 |
| Subject: | RE: [PHP-DB] checking for empty array from a form field? grrrrrrr rrrr! | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-25465@lists.php.net to get a copy of this message | ||
What about:
count($arrayname)
Should tell you how many items are in an array.
> -----Original Message-----
> From: Aaron Wolski [mailto:aaronjw@martekbiz.com]
> Sent: Wednesday, February 05, 2003 4:04 PM
> To: php-db@lists.php.net
> Subject: [PHP-DB] checking for empty array from a form field?
> grrrrrrrrrrr!
>
>
> Argh !!!!!!!!
>
>
> HOW does one check for an array being empty from a form
> field??????????
>
> Tried a billion different things and NOTHING works!!!!
>
> I've tried:
>
> if ($products == "\n") {
>
> echo "hello";
> }
>
> else {
>
> echo "bye";
>
> }
>
>
> if ($products == "") {
>
> echo "hello";
> }
>
> else {
>
> echo "bye";
>
> }
>
>
>
> if (empty($products)) {
>
> echo "hello";
> }
>
> else {
>
> echo "bye";
>
> }
>
>
> if (!isset($products)) {
>
> echo "hello";
> }
>
> else {
>
> echo "bye";
>
> }
>
>
> if (count($products) == 0) {
>
> echo "hello";
> }
>
> else {
>
> echo "bye";
>
> }
>
>
> NOTHING works!!!
>
> Any help.. puuulease?
>
> Aaron
>