If only returns the first result [duplicate]

-2

Hello, I have the problem in the code where my "IF" only returns the first result:

if ($aluno['janimal']="1"){
    $animal = "Réptil";}          
elseif($aluno['janimal']="2"){
    $animal ="Cavalo";}
elseif($aluno['janimal']="3"){
    $animal ="Porco";}
elseif($aluno['janimal']="4"){
    $animal ="Tartaruga";}
elseif($aluno['janimal']="5"){
    $animal ="Roedores(Coelho, Chinchila, hamster)";}
elseif($aluno['janimal']="6"){
    $animal ="Peixes";}
elseif($aluno['janimal']="7"){
    $animal ="Aves";}
elseif($aluno['janimal']="8"){
    $animal ="Gato";}
elseif($aluno['janimal']="9"){
    $animal ="Cão";}
elseif($aluno['janimal']="10"){
    $animal ="Invertebrados";}
elseif($aluno['janimal']="11"){
    $animal ="Anfibios";}
else{
    $animal ="Outros";}

Is there a problem?

I call the variable "$ animal" at another time ....

    
asked by anonymous 23.01.2018 / 18:50

1 answer

3

It must be == instead of just =

    
23.01.2018 / 18:51