Just to clear up, there is no isempty() function - the correct function
is empty() and its details can be found here: http://uk.php.net/empty
Cheers
Chris
-{ Rene Brehmer }- wrote:
At 01:54 20-09-2004, Chris Mach wrote:
What is the best way to determine if a variable is empty?
I have a feeling th
if youdo
if($var) {
}
and var doesnt exist at all, thats an error.
if(isset($var)) {
}
will test to see if $var exists, but will not test the value of var, so
$var could be blank...
Jason
"Pat" <[EMAIL PROTECTED]> wrote:
>
> So, you have to know, first, what is your meaning of your empty
So, you have to know, first, what is your meaning of your empty variabe:
null, 0, "", array()?
For example, "$var = 0;", empty($var) says true... but you?
"Jason Davidson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> as suggeted the isset and empty functions are usefull,
> or if
as suggeted the isset and empty functions are usefull,
or if you know it may be set, but could be empty, how about just
if($variable) {
}
that is the same as
if($var == "")
"Chris Mach" <[EMAIL PROTECTED]> wrote:
>
> What is the best way to determine if a variable is empty?
>
> I have a feel
At 01:54 20-09-2004, Chris Mach wrote:
What is the best way to determine if a variable is empty?
I have a feeling there is a better way than the way I'm doing it now...
if ($variable == "")
there's 2:
if (isset($variable))
or
if (isempty($variable))
what's most appropriate depends on how the variab
What is the best way to determine if a variable is empty?
I have a feeling there is a better way than the way I'm doing it now...
if ($variable == "")
You could try the empty() or isset() functions, depending upon exactly
what you're wanting to test. See the manual for descriptions of both.
Larry
What is the best way to determine if a variable is empty?
I have a feeling there is a better way than the way I'm doing it now...
if ($variable == "")
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - R
[snip]
Is there something that has to be done to php so that it sees these
variables? Is this an operating system issue? Anything else I should
be
looking at?
[/snip]
register globals is off, so all of your variables are in the POST array
$_POST['first']
$_POST['last']
etc. Replace all your
Hello:
I am just starting to learn php and have been reading tutorials that I
have found on the Internet.
The one I am reading now is:
http://www.freewebmasterhelp.com/tutorials/phpmysql/1
The problem I am having is with these two scripts.
Script 1:
(This script displays some forms to type i
9 matches
Mail list logo