Thread
:
problem with PHP
View Single Post
05-10-2006, 08:38 AM
#
2
(
permalink
)
office politics
It's all just 1s and 0s
Join Date: Jan 2004
Location: in the lab
Posts: 4,413
if a = 1 it displays a
then it evaluates the second if else
so since a is not 0, it echo's b
to prevent b from being displayed, put a else after echo a.
Code:
<? if ($a == 1) echo "a"; else { if ($a == 0) echo ""; else echo "b"; } ?>
__________________
'If you don't stand for somethin, you'll fall for anything' - Dr. Dre
Been there, done that
Geeks Are Sexy.net
|
ExtremeTech.com
|
ASP Free.com
|
Think Geek.com
|
Sys Opt.com
|
Code Guru.com
Trax In Space.com
|
HowTo Forge.com
|
Lazy Forums.com
|
Warrior Nation.net
|
DevGuru.com
|
Tech IMO.com
Rootsecure.net
|
SQLServerCentral.com
|
Code Project.com
|
RunAs Radio.com
|
Lockergnome IT Pros
office politics
View Public Profile
Send a private message to office politics
Find More Posts by office politics