create parent child array from inline data in php

Posted by abhie on Stack Overflow See other posts from Stack Overflow or by abhie
Published on 2012-09-17T02:36:49Z Indexed on 2012/09/17 3:37 UTC
Read the original article Hit count: 466

Filed under:
|

actually i have simple problem but i forget how to solve it.. :D i have data on table with following format
01 Johson 01 Craig
01 Johson 02 Daniel
01 Johson 03 Abbey
02 Dawson 01 Brown
02 Dawson 02 Agust
03 Brick 01 Chev
03 Brick 01 Flinch

so i want it to become an array like this
01 Johson => 01 Craig
``````````````02 Daniel
```````````````03 Abey ` etc...
how to iterate trough the data and make it array like that... i'm newby in PHP :))

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays