在多维数组中取消设置重复项

时间:2017-10-10 11:11:46

标签: php arrays multidimensional-array

任何人都可以提供帮助。我想消除下面数组mcs_client_ec_no上的重复项,但无法弄清楚如何。

Array
(

[1] => Array
    (
        [mps_client_ec_no] => REG5
        [mcs_client_ec_no] => GL98888
        [mps_school_id] => 6
        [mcs_school_id] => 6
    )

[2] => Array
    (
        [mps_client_ec_no] => TAS4752
        [mcs_client_ec_no] => ALF1252
        [mps_school_id] => 14
        [mcs_school_id] => 14
    )

[3] => Array
    (
        [mps_client_ec_no] => MAP002
        [mcs_client_ec_no] => ALF1252
        [mps_school_id] => 14
        [mcs_school_id] => 14
    )

)

1 个答案:

答案 0 :(得分:0)

试试这个

$u = array(0=>array("mcs_client_ec_no" => GL98888,"mps_school_id" => 14),1=>array("mcs_client_ec_no" => GL98888,"mps_school_id" => 154)); 

array_unique($u);