klasss Posted August 25, 2014 Report Share Posted August 25, 2014 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 Report Share Posted August 25, 2014 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 Report Share Posted August 25, 2014 (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 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