萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> php編程 >> php 刪除二維數據重復值

php 刪除二維數據重復值

php 刪除二維數據重復值
<?php
        $a = array(array(88,'中國'),array(88,'中國'),array(88,'中國'),array(89,'虎虎'),array(89,'呼喚'));
        $arr=array_chunk($a,3);
        foreach($arr as $key=>$value){
                $row[]=array_unique($arr[$key]);
        }
        foreach($row as $key=>$value){
                if(is_array($value)){
                        foreach($value as $k=>$v){
                                $rows[]=$v;
                        }
                }
        }
        $count=count($rows);
        $rows[$count]=$a[count($a)-1];
        echo"<pre>";
        print_r($rows);
?>

copyright © 萬盛學電腦網 all rights reserved