Hi again!

I talked to the admin guy and he said there is an easyer way to do this (as
usual he doenst have the time to show me) so I try here:

He gave me a liddle example in c and a light translation to PHP:

Bubble sort  (exampel written in c, but can "easyly" be translated to php):
for (i=0; i<n-1; i++) {
  for (j=0; j<n-1-i; j++)
    if (a[j+1] < a[j]) {  /* compare the two neighbors */
      tmp = a[j];         /* swap a[j] and a[j+1]      */
      a[j] = a[j+1];
      a[j+1] = tmp;


More example of Bubble Sort:

The if-sentense must here be written to
if($a[$j+1]->publisertLang < $a[$j]->publisertLang)
where a is $ingresser and $n is the number of elements in $ingresser.


The if sentese is going in the php file pastet yesterday.

Not that yeasterdays metod did'nt work, but if somebody has an idea on this
one and can give me a full example based on the info i've pastet yesterday
it would be great!

A. Lyse

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to