Re: checking for empty array from a form field? grrrrrrrrrrr!
| From: | Jeff Pauls | Date: | Wed, 05 Feb 2003 22:36:45 +0000 |
| Subject: | Re: checking for empty array from a form field? grrrrrrrrrrr! | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-25473@lists.php.net to get a copy of this message | ||
try :
if (strlen($products) == 0) {
echo "nothing entered in field";
}
http://www.php.net/manual/en/function.strlen.php
Jeff
----- Original Message -----
From: "Aaron Wolski" <aaronjw@martekbiz.com>
To: <php-db@lists.php.net>
Sent: Wednesday, February 05, 2003 3:03 PM
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
>