Page 1 of 1

Sorting an array

Posted: Thu Mar 22, 2007 8:37 am
by malcolmboston
I have an array that looks like this:

Code: Select all

Array
(
    [0] => Array
        (
            [productName] => Isla Mujeres
            [productStockCode] => 72870
            [productColour] => Raw Denim
            [productOnlinePrice] => 154.99
            [productQuantity] => 1
            [productSize] => Sml
            [productCategoryType] => Jeans
            [productBrandName] => Artful Dodger
        )

    [1] => Array
        (
            [productName] => Isla Mujeres
            [productStockCode] => 72870
            [productColour] => Raw Denim
            [productOnlinePrice] => 154.99
            [productQuantity] => 1
            [productSize] => Sml
            [productCategoryType] => Jeans
            [productBrandName] => Artful Dodger
        )

    [3] => Array
        (
            [productName] => Shark Camo
            [productStockCode] => 72889
            [productColour] => Pink
            [productOnlinePrice] => 119.99
            [productQuantity] => 1
            [productSize] => Sml
            [productCategoryType] => Track Top
            [productBrandName] => Artful Dodger
        )

)
i would like to sort the array so that it re-orders the numbers to 0, 1, 2, 3 and so on.

What do i need to be using?

Posted: Thu Mar 22, 2007 8:39 am
by feyd
Which numbers?

Posted: Thu Mar 22, 2007 8:48 am
by malcolmboston
the items in the original array are labelled "0, 1, 3" i would like them to be automatically re-numbered starting from 0

Posted: Thu Mar 22, 2007 9:11 am
by feyd