Quick question about PHP assosiative arrays.
Say there are two arrays:
$A=array ("AAA"=>"45", "FFF"=>"108", "GGG"=>"15");
and
$B=array ("FFF"=>"108", "GGG"=>"15", "AAA"=>"45");
Are these arrays are equal arrays? In the annother words, is the position of entry in assosiative arrays matters?
Merci beaucoup!
According to PHP official document:
http://php.net/manual/en/language.operators.array.php
$a == $b
TRUE if $a
and $b
have the same key/value pairs.
$a === $b
TRUE if $a
and $b
have the same key/value pairs in the same order and of the same types.
$A=array ("AAA"=>"45", "FFF"=>"108", "GGG"=>"15");
$B=array ("FFF"=>"108", "GGG"=>"15", "AAA"=>"45");
var_dump($A==$B);
bool(true)
var_dump($A===$B);
bool(false)