OR statement returning wrong number

前端 未结 4 602
悲&欢浪女
悲&欢浪女 2021-01-29 15:41

If i put 1 or 2 into this it will return 4. Why is this?I\'m more used to python stuff so sorry if this is rather basic.

e = 1;
f=0;

if(e==1){f=1;}
if(e==2){f=2         


        
4条回答
  •  一生所求
    2021-01-29 16:12

    For your or statement, this is what you want:

    if ( ($e == 3) || ($e == 4) ) {
        $f=4;
    }
    

提交回复
热议问题