//BUBBLE SORT
$switched = false;
/ you don't have to compare the last variable in the array one before it becuase they are in order
/
//$length = length of array
for($i = $length-1; $i>=0; $i--)
{
for($j = 0; $j < $i; $j++)
{
/hmmm, this is c coding now, so
try to transfer it over to php with your own variables, your own array
/
if(array[j] > array[j+1])
{
temp = array[j];
array[j] = array[j+1];
array[j+1] = temp;
$switched = true;
}
}
if(!$switched)
return 0;
}
/
I don't know how your array is setup, but you shouldn't have trouble converting this to your needs
i don't know if comparison between strings in this way is possible, but go for it, if not, you will have to take the first character from the string, turn it into ascii int, then compare it
/