-
- /**
- * Remove duplicate elements from the array
- * link: bbs.it-home.org
- * date: 2013/2/25
- */
- $input = array ("1" => "Apple", "Orange", "Yali", "a" => " Orange", "Banana", "Apple") ;
- $result = array_unique ( $input ) ;
- print_r ( $result ) ;
- ?>
Copy the code
Output result:
array ( [1] => apple [2] => orange [3] => pear [4] => banana )
|