jeudi 1 septembre 2016

$index as a parameter : multiple if statement issue

Please take a look at this function :

function my_func($index_bis) {
    if (!is_int($index_bis) || $index_bis > 5 || $index_bis < 0) return;
    elseif ($index_bis = 5) : echo 'This';
    elseif ($index_bis = 1) : echo 'That';
    endif;
}

What's wrong with this? I actually can't understand where is the mistake...

Thank you for your help.

Aucun commentaire:

Enregistrer un commentaire