jeudi 24 septembre 2015

PHP Weird IF statement result on boolean?

So i have this code:

echo $argi[2][$iterate2][$iterate];
if ($argi[2][$iterate2][$iterate]==TRUE){
    echo " It's true ";
}

And the result is:

true It's true

or

false It's true

Do you know why? I tried to change IF to var=TRUE, var===TRUE, var=="true", var=1

None of these worked. I haven't got that kind of problem earlier, it's really weird...

P.S. If statement is inside two foreach loops. I don't know if that matters somehow...

EDIT

I changed echo to var_dump, and the result is:

string(5) "false" It's true

Aucun commentaire:

Enregistrer un commentaire