<?
function cmp ($a, $b) {
if ($a == $b) return 0;
// $a is upper and $b in lower (same letter)
if ($a == strtoupper($b)) return 1;
// $a is lower and $b in upper (same letter)
if ($b == strtoupper($a)) return -1;
// other cases
if (strtoupper($a) > strtoupper($b)) return -1;
return 1;
}
$a ="rRaAtT";
echo "OLD: $a<br>";
for($i=0 ; $i<strlen($a)-1 ; $i++){
for ($j=$i+1 ; $j<strlen($a);$j++){
if (cmp($a[$i],$a[$j])<0){
$tmp=$a[$i];
$a[$i]=$a[$j];
$a[$j]=$tmp;
}
}
}
echo "NEW: $a<br>";
?> Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com