php删除二维数组中的重复值方法

栏目: 编程语言 · PHP · 发布时间: 7年前

内容简介:下面小编就为大家分享一篇php删除二维数组中的重复值方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

实例如下所示:

//二维数组去掉重复值
 public function a_array_unique($array){
  $out = array();

  foreach ($array as $key=>$value) {
   if (!in_array($value, $out)){
    $out[$key] = $value;
   }
  }

  $out = array_values($out);
  return $out;
 }

以上所述就是小编给大家介绍的《php删除二维数组中的重复值方法》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

How to Think Like a Computer Scientist: Learning with Python

How to Think Like a Computer Scientist: Learning with Python

Allen B. Downey、Jeffrey Elkner、Chris Meyers / Green Tea Press / 2002-1-4 / USD 24.95

""How to Think Like a Computer Scientist"" is an introduction to programming using Python, one of the best languages for beginners. This is a Free Book -- you can download it from thinkpython.com. But......一起来看看 《How to Think Like a Computer Scientist: Learning with Python》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具