php删除数组重复值代码
<?php
$a = array(array(88,'www.111cn.net'),array(88,'www.111cn.net'),array(88,'www.111cn.net'),array(89,'虎虎'),array(89,'呼唤'));
$new_a=array_chunk($a,3);
$arr = array();
$arr[] = array_unique($new_a[0]);
$arr[] = $new_a[1];
echo '<pre>';
print_r($arr);
?>
<?php
$a = array(array(88,'www.111cn.net'),array(88,'www.111cn.net'),array(88,'www.111cn.net'),array(89,'虎虎'),array(89,'呼唤'));
$arr=array_chunk($a,3);
foreach($arr as $key=>$value){
$row[]=array_unique($arr[$key]);
}
echo"<pre>";
print_r($row);
?>
时间: 2024-11-18 14:45:44