So I have lots of arrays of the form:
$e = array(
"key1" => "value1",
"key2" => "value2",
"key3" => "value3",
"key4" =? "value4"
);
And another array just declared as:
$a = array( );
What I want is to append $e to $a as an element, so
$a[0] = array(
"key1" => "value1",
"key2" => "value2",
"key3" => "value3",
"key4" =? "value4"
);
So I can then go:
$count = count( $a );
for ( $j = 0; $j < $count; $j++ )
{
echo $a[$j]["key1"];
}
and it will print "value1".
I will be repeating this process for all of the $e, so $a may not always be empty when the $e is appended - it may have had other $e appended previously. I thought that array_push would do this but it doesn't. Thanks for any help.