RE: [PHP] newbie's question
| From: | Van Andel, Robert | Date: | Sat, 16 Nov 2002 01:09:36 +0000 |
| Subject: | RE: [PHP] newbie's question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-124680@lists.php.net to get a copy of this message | ||
Yes it would. I like to make things complicated :)
Robbert van Andel
-----Original Message-----
From: Steve Keller [mailto:skeller@healthtvchannel.org]
Sent: Friday, November 15, 2002 5:11 PM
To: php-general@lists.php.net
Subject: RE: [PHP] newbie's question
Err... sorry. The logic was there but my fingers got a bit ahead of my
brain. The check works, but if you want to just check if it's empty turn
the conditional to a negative, like so:
if (!$testVar) {
etc.
}
That makes it "If NOT $testVar"
> I may be crazy, but wouldn't if ($variable) work just as well? If the
string is empty it'll return a negatory on that check.
>
> Lemme double check that.
>
> $testVar = "";
> if ($testVar) {
> echo "Yes";
> }
> else {
> echo "No";
> }
>
> Yeah, ok. That ran just fine under 4.2.3.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: skeller@healthtvchannel.org
Web: www.healthtvchannel.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
"The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers."