Last active
February 13, 2017 15:40
-
-
Save YurePereira/0e283541d34ae8c30ada785a660d8da8 to your computer and use it in GitHub Desktop.
Usando o operador de igualdade e identidade de Array.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $firstArray = array( | |
| 'b' => 'Black', | |
| 'w' => 'White', | |
| 'g' => 'Gray', | |
| ); | |
| $secondArray = array( | |
| 'g' => 'Gray', | |
| 'b' => 'Black', | |
| 'w' => 'White', | |
| ); | |
| //Verificando se os dois Arrays são iguais: | |
| var_dump($firstArray == $secondArray);//bool(true) | |
| //Verificando se os dois Arrays são iguais e suas chaves então na mesma ordem: | |
| var_dump($firstArray === $secondArray);//bool(true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment