mercredi 27 mars 2019

How to fix Comparative if statement in PHP?

how are you?

I am trying to compare a simple variable in php, the problem that i am having is at the time to see the result, my code prints the wrong answer. I do not know what could be the problem, i have tried to use different Logical Operators but it did not work.

What could be the problem?

Looking forward to a response and thank you in advance.

<?php

       $code_icon = 'green';

       if ($code_icon == '1030' || '1929' || 'aaa'){
           echo 'eeeooo';
       } elseif ($code_icon == 'banaba' || 'fruit' || 'green') {
           echo 'ayuwokiii';
       } 


Sandbox: http://sandbox.onlinephpfunctions.com/code/950e02ff7520f48ebb63e2fce747433fff2223c8

Aucun commentaire:

Enregistrer un commentaire