I am checking the array_unique function. The manual says that it will also sort the values. But I cannot see that it is sorting the values. Please see my sample code.
$input = array("a" => "green", 3=>"red", "b" => "green", 1=>"blue", "red");
print_r($input);
$result = array_unique($input,SORT_STRING);
print_r($result);
The output is
Array
(
[a] => green
[3] => red
[b] => green
[1] => blue
[4] => red
)
Array
(
[a] => green
[3] => red
[1] => blue
)
Here the array $result is not sorted. Any help is appreciated.
Thank you Pramod