我已经有我使用json_decode()
,其输出的JSON文件作为一个数组的内容解析JSON文件添加了所有INT()值,这是数据输出的一个示例:从PHP阵列
array(1) {
["petition"]=>
array(2) {
["postal_districts"]=>
array(2257) {
["DH4"]=>
int(12)
["BT5"]=>
int(14)
["WA9"]=>
int(72)
["EH17"]=>
int(5)
}
}
}
我想从在“postal_districts”但此刻,我不知所措,我怎么能做到这一点加起来所有的int()
值。
任何帮助,非常感谢。
可能重复[如何选择我添加数组中的所有值?](http://stackoverflow.com/questions/6695140/php-add-up-values-in-object-array) – 2013-02-23 21:56:40