Looking at the documentation for natcasesort in PHP it sorts the array in a case insensitive way. However after I try to rearrange a two unordered arrays that contain the same letters, and check if they are equivalent it give me false. See below:
$ary=array("b", "z", "A", "C", "S");
$ary1=array("A", "z", "b", "S", "C");
natcasesort($ary);
natcasesort($ary1);
print_r($ary);
print_r($ary1);
if ($ary==$ary1) {
echo "True";
} else {
echo "False";
}
The results I get are:
Array ( [2] => A [0] => b [3] => C [4] => S [1] => z )
Array ( [0] => A [2] => b [4] => C [3] => S [1] => z )
False
This obviously is because it still saves the original position of the letter in the original array. How can I change the original postion displayed in the brackets to change permanently into an increasing count (in this case 0 to 4 in case-insensitive alphabetical order)?