1

Okay my function order alphabetical all my values correctly, except, when I have in a field some name like (à,è,é,... etc ). there is a way i can order it too, i will show my code, thanks.

usort($xmls, "sortbyname" );

function sortbyname($a, $b){
    return strcmp($a[name],$b[name]);
}

print_r( $xmls );

As i said, it is fine , it works fine with this letters = a,b,c,d,e...etc, but when it read some letter like : 'É', it just put in the last position, because it read like a special character i guess, thanks you all.

Example INPUT - OUTPUT

$input = a,  é,d, e, ,f, g,b, c,á,h, i.... etc
$output = a,á,b,c,d,e,é,f,g,h,i .... ect

Thanks guys..

someone give me this as answer: Sort an array with special characters in PHP

but it doesnt work, because it give me this as input-output:

$input = a,  é,d, e, ,f, g,b, c,á,h, i.... etc
$output = á,é,a,,b,c,d,e,f,g,h,i .... ect

so obviusly thats wrong, thanks

Community
  • 1
  • 1
Alberto Acuña
  • 482
  • 1
  • 9
  • 25

0 Answers0