dimanche 25 juin 2017

PHP if Statement numbers as strings

$InboundTextBody ="1". When the code runs it does not set $TypeOptions = good however if I spell the word one like $InboundTextBody ="one" then I get great. How can I get the if statement to recognize a input 1 as a string

if ($InboundTextBody === "1"){
    $TypeOptions = "good";
}
elseif ($InboundTextBody === "One"){
    $TypeOptions = "great";
}
elseif ($InboundTextBody === "3"){
    $TypeOptions = "best";
}

Aucun commentaire:

Enregistrer un commentaire