Timeline for Create associative array from an associative array of objects
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 29, 2012 at 5:59 | vote | accept | Chriser | ||
| Apr 29, 2012 at 5:57 | comment | added | Tad Bumcrot | Hah, and I accidentally edited my reply to your reply, not seeing your new reply. I had a mis-read your desired output .. the answer was updated-- just change the line to read: $colors[$colour]=$image->id; | |
| Apr 29, 2012 at 5:54 | comment | added | Chriser | filename will be consistent and I might work on that later, here problem is with the code, array have there own key now. The key should be colour. | |
| Apr 29, 2012 at 5:54 | history | edited | Tad Bumcrot | CC BY-SA 3.0 |
Misread the 'desired output' ... fixed the '$colors[$colour]=$image->id;
|
| Apr 29, 2012 at 5:53 | comment | added | Tad Bumcrot | edited the answer. Apologies for the confusion. The line that adds the items to the array was wrong. | |
| Apr 29, 2012 at 5:50 | comment | added | Chriser | small problem Array ( [0] => Array ( [Blue] => 1620 ) [1] => Array ( [Green] => 1621 ) [2] => Array ( [Red] => 1622 ) [3] => Array ( [White] => 1623 ) [4] => Array ( [Bronze Left] => 1670 ) [5] => Array ( [Bronze Right] => 1671 ) [6] => Array ( [Chrome Left] => 1672 ) [7] => Array ( [Chrome Right] => 1673 ) ) | |
| Apr 29, 2012 at 5:41 | history | answered | Tad Bumcrot | CC BY-SA 3.0 |