View Single Post
Old 05-10-2006, 08:38 AM   #2 (permalink)
office politics
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,413

office politics will become famous soon enough

Default

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";
	}
	?>

office politics is offline