我有 2 个 2D 数组,如何获取唯一的键并只推送这些键?例如:
$array = json_decode('[{"7654321":1368356071},{"1234567":1368356071}]',true);
$array2 = array(array(1234567 => time()), array(7654321 => time()), array(2345678 => time()));
//array_push($array, $array2[2]);
-- 如何动态获取像本例中的 $array2[2] 这样的唯一键?
最佳答案
为什么不在 php 中使用 array_unique() 函数? http://php.net/manual/ru/function.array-unique.php
关于php - 如何防止 array_push 中出现重复键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16507719/