lundi 7 décembre 2015

laravel 5.1 OR in if statement not working

Okay,

simple IF statement, simple code, can't find the solution for some reason

if (substr(Auth::User()->email, -14) != "@thomasmore.be" || substr(Auth::User()->email, -22) != "@student.thomasmore.be")
    {
        echo substr(Auth::User()->email, -14);
    }

echoes:

@thomasmore.be

when I just use:

if(substr(Auth::User()->email, -14) != "@thomasmore.be") 

it works perfectly.

What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire