好吧,所以我想弄清楚如何将数据添加到关联数组中。数组看起来像:
Array
(
[games] => Array
[game] => Array
[0] => Array
[appID] => 12345
[logo] => 'http://www.example.com/logo_12345.jpg'
[name] => 'Game One'
[1] => Array
[appID] => 12346
[logo] => 'http://www.example.com/logo_12346.jpg'
[name] => 'Game Two'
[2] => Array
[appID] => 12347
[logo] => 'http://www.example.com/logo_12347.jpg'
[name] => 'Game Three'
[userID] => 784523569852145
[username] => 'Gamertag'
)
我想要做的是循环遍历数组并向其中添加以下元素,使其看起来像这样:
Array
(
[games] => Array
[game] => Array
[0] => Array
[appID] => 12345
[logo] => 'http://www.example.com/logo_12345.jpg'
[name] => 'Game One'
[status] => 'active'
[1] => Array
[appID] => 12346
[logo] => 'http://www.example.com/logo_12346.jpg'
[name] => 'Game Two'
[status] => 'active'
[2] => Array
[appID] => 12347
[logo] => 'http://www.example.com/logo_12347.jpg'
[name] => 'Game Three'
[status] => 'active'
[userID] => 784523569852145
[username] => 'Gamertag'
)