Page 1 of 1

array keys

Posted: Fri Dec 22, 2006 8:45 am
by malcolmboston
I have an array that looks like this

Code: Select all

[cart] => Array
        (
            [0] => Array
                (
                    [productID] => 3
                    [productStockCode] => 72650
                    [productColour] => Dark Denim
                    [productOnlinePrice] => 119.9900
                    [productFullName] => Artful Dodger Flocked Jeans
                    [quantity] => 2
                )

        )
            [1] => Array
                (
                    [productID] => 3
                    [productStockCode] => 72650
                    [productColour] => Dark Denim
                    [productOnlinePrice] => 119.9900
                    [productFullName] => Artful Dodger Flocked Jeans
                    [quantity] => 2
                )

        )
when i delete key [0] the array starts again at 1, i want the array to start from 0 always and go up in 1's how can i do this? is there a built in function?

Posted: Fri Dec 22, 2006 8:52 am
by jmut

Code: Select all

$array = array_values($array);