So I have 2 questions:
- from what I understand natsort() is supposed to sort an array alphabetically case insensitively but once I compile the code below.
<?php
function splitSort($sentence){
$stringArray = explode(" ",$sentence);
natsort($stringArray);
for($i=0; $i<count($stringArray);$i++){
echo $stringArray[$i] . ", ";
}
}
splitSort("Hellod darkness hello My old");
?>
I get
Hellod, darkness, hello, My, old,
where i thought I was supposed to get
darkness, hello, Hellod, My, old
- If the sorting was truly case insensitive and the expected result would occur if I change Hellod to Hello which hello would come first?