php 二维数组去重

一、简单的二维数组去重

<?php
$tmp = array();
$result = array();
foreach($aData as $key => $val){
$tmp[$key] = json_encode($val);
}
unset($val);
$final = array_unique($tmp);
foreach($final as $key => $val){
$result[$key] = json_decode($val, true);
}

posted @ 2017-10-19 23:11  i0ject  阅读(651)  评论(2编辑  收藏  举报