12,996,841 members (133,235 online)
Rate this:
See more:
hi, i have question about php arrays. i have array like \$data.
```	\$data=array(
array('a'='1','b'='2','c'='3','d'='4'),                                             array('a'='5','b'='6','c'='7','d'='8'),                        array('a'='9','b'='10','c'='11','d'='12')
);```

i want to get only a,c,d element and create another multi dimensional array like \$data1.
```
\$data1=array(
array('a'='1','c'='3','d'='4'),
array('a'='5','c'='7','d'='8'),
array('a'='9','c'='11','d'='12')
);
```

as a next step i wanted to sort \$data1 array by first value of d elements then by value of c elements and finally by a elements and get array like \$data2.
```\$data2=array(
array('a'='9','c'='11','d'='12')
array('a'='5','c'='7','d'='8'),
array('a'='1','c'='3','d'='4')
);
```

i need little bit explained answer to each step. i'm stuck in here this problem. i want help..
and are there any php array function available for get \$data1 array from \$data easily?
Posted 29-Mar-13 0:20am
Updated 29-Mar-13 0:22am
v2

Rate this:

## Solution 1

Top Experts
Last 24hrsThis month
 RickZeeland 195 ppolymorphe 180 OriginalGriff 140 Karthik Bangalore 90 Member 12464509 80
 OriginalGriff 4,297 ppolymorphe 2,002 Kornfeld Eliyahu Peter 1,893 RickZeeland 1,761 Richard Deeming 1,493