/** * 去除数组中重复元素 * link:bbs.it-home.org * date:2013/2/25 */ $input = array ("1" => "苹果", "橘子","鸭梨", "a" => "橘子", "香蕉", "苹果") ; $result = array_unique ( $input ) ; print_r ( $result ) ; ?> 复制代码 输出结果: array ( [1] => 苹果 [2] => 橘子 [3] => 鸭梨 [4] => 香蕉 )