Skip to content

Instantly share code, notes, and snippets.

@YurePereira
Last active February 13, 2017 15:40
Show Gist options
  • Select an option

  • Save YurePereira/0e283541d34ae8c30ada785a660d8da8 to your computer and use it in GitHub Desktop.

Select an option

Save YurePereira/0e283541d34ae8c30ada785a660d8da8 to your computer and use it in GitHub Desktop.
Usando o operador de igualdade e identidade de Array.
<?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