note 36516 deleted from function.sort by derick

From: Date: Wed, 31 Aug 2005 10:40:10 +0000
Subject: note 36516 deleted from function.sort by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-94506@lists.php.net to get a copy of this message
Note Submitter: edu_chaos at yahoo dot com dot br ---- A simple sort 2 array 1D (bublesort) <?php // init var $tam = sizeof($arr ) ; $i=0; $aux=0; $change = true; // the sort while( $i<$tam && $change ): $j=0; $troca = false; while( $j < $tam-$i-1 ): if( $arr[$j] > $arr[$j+1] ): $aux = $arr[$j]; $arr[$j] = $arr[$j+1]; $arr[$j+1] = $aux; $troca = true; endif; $j++; endwhile; $i++; endwhile; ?>

« previous php.notes (#94506) next »