array_unique() sorts the values treated as string at first, then will keep the first key encountered for every value, and ignore all following keys.
<?php
$a = array('s3', 's1', 's3', 's2');
$a = array_unique($a);
print_r($a);
?>
Array ( [0] => s3 [1] => s1 [3] => s2 )