klasss Posted August 25, 2014 at 01:25 PM Report Share #565452 Posted August 25, 2014 at 01:25 PM Boas, Surgiu-me um duvida quando estava a fazer o Laço For Qual é a diferença entre = ou == ou === $Valor = "SELECT max(id) FROM tb_empresa"; For ($contador = 0; $contador == $Valor; $contador++){ Link to comment Share on other sites More sharing options...
AJBM Posted August 25, 2014 at 01:30 PM Report Share #565453 Posted August 25, 2014 at 01:30 PM Boas! Vê isto http://stackoverflow.com/questions/589549/php-vs-operator Link to comment Share on other sites More sharing options...
bioshock Posted August 25, 2014 at 03:42 PM Report Share #565457 Posted August 25, 2014 at 03:42 PM (edited) Basicamente: $a = 3; // = atribuição de valor $a == 3; // == comparação de valor $a = 1; $b = TRUE; // === compara se as variáveis possuem o mesmo tipo e valor (obrigatoriamente). $a === $b; // é falso, pois $a = 1 e $b = TRUE $a == $b; // é verdadeiro, porque a representação de 1 em código pode ser interpretada como verdadeiro (TRUE) Edited August 25, 2014 at 08:02 PM by bioshock 2 Report Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now