samedi 24 juin 2017

PHP If Statement conditions not working

if($InboundTextBody === 'Help' OR 'help'){
   echo 'help';
} 
elseif($InboundTextBody === 'Reset'){
      echo 'send reset message';
}
elseif($InboundTextBody === 'Start'){
       echo 'send start message';
}

if($InboundTextBody === 'Help' || 'help'){
   echo 'help';
} 

If my $InboundTextBody has the word Help. It will echo Help. If the $InboundTextBody has the word Reset it still echo help. it never echo reset. I need the or in my statement just in case the $InboundTextBody text has up case or lower case text

Aucun commentaire:

Enregistrer un commentaire