whats wrong with the code below?

        function bubblesort(&$vetor,$tam)
        {
                $trocou=true;
                $i=$j=0;
                
                while($trocou)
                {
                        $trocou=false;
                        for($j=0; $j<$tam-$i; $j++)
                        {
                                if($vetor[$j] > $vetor[$j+1])
                                {
                                        $aux=$vetor[$j];
                                        $vetor[$j]=$vetor[$j+1];
                                        $vetor[$j+1]=$aux;
                                }
                                $i++;
                        }
                }
        }

it's right right?
so why when I print the array (with a for(;;) or with print_r) it still 
shows me it's not ordered... I printed it INSIDE the function... what's the 
thing here? I'm I nuts?

p.s: meu novo email é [EMAIL PROTECTED]
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to