//sorting

$j=0;

$flag = true;

$temp=0;

while ( $flag )

{

$flag = false;

for( $j=0;  $j < count($array_attr)-1; $j++)

{

//echo $j;

if ( $array_attr[$j][“label”] > $array_attr[$j+1][“label”] )

{

$temp = $array_attr[$j];

//swap the two between each other

$array_attr[$j] = $array_attr[$j+1];

$array_attr[$j+1]=$temp;

$flag = true; //show that a swap occurred

}

}

}

//sorting end

Your Answer
Sign In
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.