I have associative array which looks like this.
$arr = array(
"FIRST" => 1,
"SECOND => 2,
"FOURTH => 4
);
The idea is how to "add" data to this array depending of expression. Here is what I'm trying to do:
if(3 == 3) {
$str = array("THIRD" => 3);
}
$arr = array(
"FIRST" => 1,
"SECOND => 2,
$str,
"FOURTH => 4
);
The problem is that the code above add $str as an array in $arr, not like "THIRD" => 3
", and3 == 3is always true.