Re: True or not true

From: Date: Tue, 18 Jul 2000 11:40:32 +0000
Subject: Re: True or not true
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-1237@lists.php.net to get a copy of this message
Vojtech Dvorak wrote: > Hi, > I just made a little function for resolving true and false phase. > But even I change $trueorfalse to 0, It will show me "1, checked". > Why? I thing this is newbie fault, but I can't really hit the wall with > right solution. > Thanks for help > > <?PHP > function checked($value){ try this: if ($value ==1){ instead this: > if ($value = 1){ since $value=1 is an assignment and $value==1 is comparison! > > echo $value; > echo "<br>checked"; } > else { > echo $value; > echo "<br>unchecked";} > } > $trueorfalse=1; > checked($trueorfalse); > ?> Cheers, ------------------- Salman AS (SaS) salmanas@telkom.net -------------------

« previous php.db (#1237) next »