私のPHP側には、次のような連想配列の配列があります。
Array (
[0] => Array (
[resultId] => 15
[testId] => 4
[accountId] => 35
[score] => 50
[standard_deviation] => 0.5
[answer_time] => 475.67
[created_at] => 2012-09-20 01:45:05
[groupId] => 4
[accountName] => hbbgrewkcx
[testName] => test1),
[1] => Array (
[resultId] => 14
[testId] => 3
[accountId] => 35
[score] => 60
[standard_deviation] => 0.5
[average_answer_time] => 386.1
[created_at] => 2012-09-20 01:44:56
[groupId] => 4
[accountName] => hbbgrewkcx
[testName] => test2)
)
この配列をjavascript側に転送したいと思います。この連想配列の配列に対応する JavaScript を作成し、必要な値にアクセスするにはどうすればよいですか?
基本的に、foreach が PHP で提供するのと同じ機能が必要です。
foreach($ArrayOfArrays as $array)
{
doSomething $array['testName'];
doSomething $array['created_at'];
}