PHP数组去重

/**
 * 数组去重
 */
public function arrayUnique($arr) {
    $count = count($arr);
    $res = [];
    for ($i = 0;$i < $count ;$i++) {
        $tmp = $arr[$i];
        unset($arr[$i]);
        if (!in_array($tmp,$arr)) {
            $res[] = $tmp;
        }
    }
    return $res;
}
原文地址:https://www.cnblogs.com/jiqing9006/p/12910948.html