And PHP's functions ride to the rescue again...
$string='HushPuppies';
$array=preg_split('//',$string,-1,PREG_SPLIT_NO_EMPTY);
natcasesort($array);
$string=join('',$array);
But really, I'm getting more and more curious about what all these string manipulations are in aid of...