I really hope you help me with this problem, I hope this make sence for you - I have this pseudo example of foreach loop:
foreach_loop {
$k1 = GetKey1();
$v1 = GetValue1();
$k2 = GetKey2();
$v2 = GetValue2();
$k3 = GetKey3();
$v2 = GetValue3();
// now I put those keys and values in associative array called DataArr
$DataArr[$k1] = $v1;
$DataArr[$k2] = $v2;
$DataArr[$k3] = $v3;
}
now my question is, how do I create an array where each index of it contain an associative array created from that foreach loop and keep appending to itself like this:
$resultArr = array(
0 => "DataArr_from_loop1",
1 => "DataArr_from_loop2",
2 => "DataArr_from_loop3",
3 => "DataArr_from_loop4"
//...etc
)
and when I check for $resultArr[0] I should get an associative array like this:
array (size=3)
'k1' => string 'v1'
'k2' => string 'v2'
'k3' => string 'v3'
I really need your help, thank you in advance.