Date: 07/10/01
- Next message: alexus: "[PHP] PHP 4.0.6 and TSRM, I can't compile it! please help"
- Previous message: Ben Bleything: "RE: [PHP] How to fetch a "group by" Query?"
- In reply to: elias: "[PHP] Re: form action problem"
- Next in thread: Jeff Lewis: "[PHP] Average of column..."
- Reply: Jeff Lewis: "[PHP] Average of column..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> Adam,
> It's really better to use the isset() instead of empty() because if you
set
> the error level report to E_ALL you will see that PHP will produce
warnings
> if the variable is not set at all!
empty() and isset() are totally different.
If a variable is set, but is set to nothing (or a value of 0), then the
isset() will still hold true, whereas empty() will check that the variable
contains a value other than a blank or 0.
A workaround to the empty() statement?
if ( (isset($var)) && (!empty($var)) )
{
}
or:
if ($var!='')
{
}
There are other ways to do this but the main point is making sure the
varible is not passed as empty when the form is used.
-Adam
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: alexus: "[PHP] PHP 4.0.6 and TSRM, I can't compile it! please help"
- Previous message: Ben Bleything: "RE: [PHP] How to fetch a "group by" Query?"
- In reply to: elias: "[PHP] Re: form action problem"
- Next in thread: Jeff Lewis: "[PHP] Average of column..."
- Reply: Jeff Lewis: "[PHP] Average of column..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

