On Fri, 23 Jan 2004, NIPP, SCOTT V (SBCSI) wrote:
> I am trying to populate an array from a MySQL database. I think I
> have the code correct to populate the array, but I need to somehow sort the
> array eliminating duplicate values. I think I can loop through the array
> doing a compariso
NIPP, SCOTT V (SBCSI) wrote:
> I am trying to populate an array from a MySQL database. I think I
> have the code correct to populate the array, but I need to somehow
> sort the array eliminating duplicate values. I think I can loop
> through the array doing a comparison and building a new a
Just loop through the first index, then search on the second index:
while ( list( $key, $value ) = each( $my_arr ) ) {
// now $value is your ( [0] => 10 [1] => 40 [2] => 50 [3] => 80 [4] =>
130 [5] => 220 [6] => 320 ) array
// sort your array by values
sort( $value ) ;
// get the