我有以下多维数组:
<?php
$array = array(
array('first' => 1, 'second' => 1),
array('first' => 1, 'second' => 1),
array('first' => 2, 'second' => 1),
array('first' => 3, 'second' => 1),
array('first' => 3, 'second' => 1),
array('first' => 3, 'second' => 1));
如何删除重复的first
值?同时保留重复second
值。
处理后的数组应该是:
array(
array('first' => 1, 'second' => 1),
array('first' => 2, 'second' => 1),
array('first' => 3, 'second' => 1));