我有一组嵌套数组。
[data] 是顶级数组。
较低级别的数组都由增量数字标识,动态分配......基本上每个子数组标识信息的行/记录。
我将如何提取子数组的计数?我需要能够将这些数据发布到数据库中。
子数组的数量是动态的,并且可以根据我正在解析的数据而改变。
[data] => Array
(
[0] => Array
(
[id] => 3475
[name] => Player1
[score] => 11870
[rank] => 213
[total_cities] => 2
[crown] => None
[alliance_id] => 134
[title] => Earl
[fame_total] => 509875
[fame_rank] => 381
[defeated_total] => 3436
[defeated_rank] => 376
[plunder_total] => 1388754
[plunder_rank] => 245
)
[1] => Array
(
[id] => 3523
[name] => Player2
[score] => 1978
[rank] => 281
[total_cities] => 1
[crown] => None
[alliance_id] => 134
[title] => Baron
[fame_total] => 0
[fame_rank] => 448
[defeated_total] => 0
[defeated_rank] => 448
[plunder_total] => 0
[plunder_rank] => 436
)
[2] => Array
(
[id] => 73
[name] => Player3
[score] => 1308
[rank] => 304
[total_cities] => 1
[crown] => None
[alliance_id] => 134
[title] => Marquess
[fame_total] => 5604153
[fame_rank] => 237
[defeated_total] => 37270
[defeated_rank] => 229
[plunder_total] => 68130
[plunder_rank] => 335
)