/hphp/test/zend/bad/ext/standard/tests/array/array_unique_variation8.php
PHP | 25 lines | 11 code | 5 blank | 9 comment | 1 complexity | cbcc36143c41874db9d8b2f5942ddefe MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?php
- /* Prototype : array array_unique(array $input)
- * Description: Removes duplicate values from array
- * Source code: ext/standard/array.c
- */
- /*
- * Testing the functionality of array_unique() by passing
- * two dimensional arrays for $input argument.
- */
- echo "*** Testing array_unique() : two dimensional array for \$input argument ***\n";
- // initialize the 2-d array
- $input = array(
- array(1, 2, 3, 1),
- array("hello", "world", "str1" => "hello", "str2" => 'world'),
- array(1 => "one", 2 => "two", "one", 'two'),
- array(1, 2, 3, 1)
- );
- var_dump( array_unique($input, SORT_STRING) );
- echo "Done";
- ?>