RE: isset() question

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

 



By the way, it might be interresting to see what this does:

if (strlen($a)) {
   print '$a is set';
} else {
  print '$a is not set' . "\n";
}

$a= "";

if (strlen($a)) {
print '$a is set';
} else {
  print '$a is not set' . "\n";
} 

-----Original Message-----
From: Svensson, B.A.T. (HKG)
To: 'php-windows@xxxxxxxxxxxxx '
Sent: 2004-02-15 17:51
Subject: RE:  isset() question

> Why doesn't the call to !isset() with the negation
> mark loads the nextpage when a name is not entered?

What do you get if you do:

if (isset($a)) {
     print '$a is set';
} else {
     print '$a is not set';
}

$a = "";

if (isset($a)) {
     print '$a is set';
} else {
     print '$a is not set';
}
You get:

F:\>c:\PHP\php -f test.php
$a is not set
$a is set
F:\>

Why? Becasue pointing to an empty string
is not the same as having no pointer at all.

Does this solve your problem?

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

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux