7.1.12、移除数组中重复的值

 
 PHP Code By tony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php

    /**
        移除数组中重复的值
     */

    $userAge = 
array('tony'=>26,'xiaosi'=>26,'jacky'=>25);
    
    print_r($userAge);
    
    
echo '<br>';
    
    
// array_unique 移除数组中重复的值
    // 创建一个新数组,新的数组已经移除重复的值
    
    $a = array_unique($userAge);
    
    print_r($a);
    
?>




原文地址:https://www.cnblogs.com/tonycody/p/2795369.html