If I am unserstanding you correctly, then your code should work. unless you are trying to use the array your created, take a look. I think a simple change could solve your problem
this would work:
$ids = array(1247, 1248);
$history['transactions'][$ids[0]][$ids[1]]['Thursday'] = 0;
So would this:
$id1 = 1247;
$id2 = 1248;
$history['transactions'][$id1][$id2]['Thursday'] = 0;
From the looks of it, you just aren't calling anything. but without more of your code I can't be more help
As Daedalus points out, to this point the code isn't really dynamic, (I assumed you just needed a snipit in the the middle to help with already dynamic code. but now I will assume the opposite) here is an example of how how to change that:
say you had the array $ids = array(1247, 1248, 1249, 1250, 1251);
you would need to loop through the lot of them and deal with them individually. Probably the easiest way to do that would be something like:
$ids = array(1247, 1248, 1249, 1250, 1251);
foreach($ids as $id){
$history['transactions'][$id]['Thursday'] = 0;
}
Make sense?
Third try:
Getting a better understanding of whats going on. (sorry, took a long time to get it through my thick skull)
So if you want an array with all the ids in order of the array $ids = array(1247, 1248, 1249, 1250, 1251);
then this is the solution for you:
$ids = array(1247, 1248, 1249, 1250, 1251);
$result = array('Thursday' => 0);
for($i = count($ids) -1; $i >= 0; $i--){
$result = array($ids[$i] => $result);
}
$history = array('transactions' => $result);
var_dump($history)
yields:
array(1) {
["transactions"]=>
array(1) {
[1247]=>
array(1) {
[1248]=>
array(1) {
[1249]=>
array(1) {
[1250]=>
array(1) {
[1251]=>
array(1) {
["Thursday"]=>
int(0)
}
}
}
}
}
}
}
Which is now what I believe you are looking for