【发布时间】:2018-09-02 09:07:27
【问题描述】:
我有两个多维数组。这些是-
Array
(
[Fortitude] => Array
(
[library_count] => 0
[crypt_count] => 7
)
[Obtenebration] => Array
(
[library_count] => 6
[crypt_count] => 11
)
[Dementation] => Array
(
[library_count] => 1
[crypt_count] => 0
)
[Obfuscate] => Array
(
[library_count] => 0
[crypt_count] => 2
)
[Necromancy] => Array
(
[library_count] => 9
[crypt_count] => 2
)
[Celerity] => Array
(
[library_count] => 0
[crypt_count] => 1
)
[Redemption] => Array
(
[library_count] => 1
[crypt_count] => 0
)
[Dominate] => Array
(
[library_count] => 19
[crypt_count] => 2
)
[Auspex] => Array
(
[library_count] => 1
[crypt_count] => 0
)
[Potence] => Array
(
[library_count] => 1
[crypt_count] => 2
)
)
和
Array
(
[Dominate] => Array
(
[library_count] => 19
[crypt_count] => 7
)
[Celerity] => Array
(
[library_count] => 0
[crypt_count] => 6
)
[Auspex] => Array
(
[library_count] => 1
[crypt_count] => 2
)
[Obtenebration] => Array
(
[library_count] => 6
[crypt_count] => 0
)
[Necromancy] => Array
(
[library_count] => 9
[crypt_count] => 1
)
[Potence] => Array
(
[library_count] => 1
[crypt_count] => 1
)
)
.. 这些数组有一些类似的键示例“Celerity”。我想在两个数组中找到公共密钥,并将它们的库和加密计数相加,并将它们变成一个数组。
【问题讨论】:
标签: php arrays sorting multidimensional-array