I'm working through the challenges on coderbyte.com to brush up on programming skills. The challenge is to sort a string $str
into alphabetical order. The output must be a string, I'm 99% my logic and code is correct but its throwing errors, Can anyone spot if I have done anything wrong before I contact coderbyte.
eg if $str = cat hat; $imp should return 'aacht' my code is:
function AlphabetSoup($str) {
$arr = str_split($str, 1);
$sorted = sort($arr);
$imp = implode('', $sorted);
return $imp;
}