Re: checking for empty array from a form field? grrrrrrrrrrr!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:  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
> 


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux