Re: True or not true
| From: | Rouvas Stathis | Date: | Tue, 18 Jul 2000 11:38:55 +0000 |
| Subject: | Re: True or not true | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1238@lists.php.net to get a copy of this message | ||
Wrong: if ($value = 1){
correct : if ($value == 1){
-Stathis.
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){
> if ($value = 1){
> echo $value;
> echo "<br>checked"; }
> else {
> echo $value;
> echo "<br>unchecked";}
> }
> $trueorfalse=1;
> checked($trueorfalse);
> ?>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
+-----------------------------+
|Rouvas Stathis |
|University of Athens |
|Department of Informatics |
|http://www.di.uoa.gr/~rouvas |
|rouvas@di.uoa.gr |
+-----------------------------+