функция array_sorting ($ string) {
// Split string sequence into array elements
$string = explode(" ", $string);
//print_r($string);
foreach($string as $str) {
// Converting words into array elements
$results = array();
preg_match_all('/./u', $str, $results);
foreach ( $results as $array ) {
// Sorting array elements
sort($array);
// Concat elements back to words
foreach($array as $val){
echo $val;
}
}
// Concat words back to sequence
echo " ";
}
}
array_sorting ('αβγαβγ αβγαβγαβγ');