正文  软件开发 > PHP编程技术 >

php 二维数组去重,php二维数组

php 二维数组去重,php二维数组一、简单的二维数组去重 <?php $tmp = array(); $result = array(); foreach ($aData as $key =>...

php 二维数组去重,php二维数组

一、简单的二维数组去重

<?php
$tmp = array();
$result = array();
foreach ($aData as $key => $val) {
    $tmp[$key] = $val;
}
unset($val);
$final = array_unique($tmp);
foreach ($final as $key => $val) {
    $result[$key] = $val;
}
var_dump($result);//保留Key的
var_dump(array_values($result));//不保留Key的
?>

未完

http://www.bkjia.com/PHPjc/1229836.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1229836.htmlTechArticlephp 二维数组去重,php二维数组 一、简单的二维数组去重 ? php $tmp = array (); $result = array (); foreach ( $aData as $key = $val ) { $tmp [ $key ] = $ val ;} u...