Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

unable to sort array

$
0
0

For some reason I can not sort the array list, can anyone tell me what I am doing wrong ?

 

My output is...

 

Array ( [0] => 2 [1] => 5 [2] => 3 )


1

$product_length = 2;
$product_width = 5;
$product_height = 3;

            // work out volume.
            $sizeArray = array();
            $sizeArraySORTED = array();
            $sizeArray = array($product_length, $product_width, $product_height);
print_r($sizeArray); ?><br><br><br><?
            $sizeArraySORTED = asort($sizeArray, SORT_NUMERIC);
print_r($sizeArraySORTED);

Viewing all articles
Browse latest Browse all 13200

Trending Articles