如何为每个数组添加+ x

I have an array which is like this :

foreach($keys as $tmpItem) {
            $item = null;
            $item['id']       = $tmpItem;
            $item['price']     = $prices[$tmpItem];
            $items[]          = $item;  
}

I want to add + 10 for each item in my array.

Item[0] = 10,

Item[1] = 20,

item[2] = 30

etc...

How can i do it ? Thanks

You need this?

$aux=0;

foreach($keys as $tmpItem) {
            $aux = $aux+10;

            $item = null;
            $item['id']       = $tmpItem;
            $item['price']     = $prices[$tmpItem];
            $items[]          = $aux;  
}

You could just do this:

 $i=0;
 foreach($keys as $tmpItem) {
        $i+=10;

        $item = null;
        $item['id']       = $tmpItem;
        $item['price']     = $prices[$tmpItem];
        $items[]          = $i;  
 }