Re: is PHP crazy, or am I?

From: Date: Fri, 14 Sep 2001 02:58:50 +0000
Subject: Re: is PHP crazy, or am I?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67302@lists.php.net to get a copy of this message
maybe I'm wrong, but don't you need a return value? ----- Original Message ----- From: "Christian Dechery" <cdechery@easynet.com.br> To: <php-general@lists.php.net> Sent: Saturday, September 08, 2001 2:24 AM Subject: [PHP] is PHP crazy, or am I? > 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 é cdechery@easynet.com.br > ____________________________ > . 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: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#67302) next »