Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. Dataset Example Row:
  2.  
  3. 0_id : 25
  4. 0_firstname : Slyvester
  5. 0_lastname : Oosterbos
  6. 1_id : 91
  7. 1_email : sly@whatever.com
  8. 2_id : 266
  9. 2_telephone : 09987 787424
  10. 3_id : 33
  11. 3_studentid : 77942421
  12. 3_schemeofstudy : 71
  13. 4_id : 101
  14. 4_projtitle : Writing a Recursive Function!
  15.  
  16.  
  17. Desired result:
  18.  
  19. array(
  20. [0] => array (
  21. [0] => array(
  22. [0] => array(
  23. 'id' => 25,
  24. 'firstname' => Slyvester,
  25. 'lastname' => Oosterbos,
  26. 'childtables' => array(
  27. [1] => array(
  28. [0] => array(
  29. 'id' => 91,
  30. 'email' => sly@whatever.com
  31. ),
  32. [1] => array(
  33. 'id' => 92,
  34. 'email' => sly@supbitch.com
  35. ),
  36. [2] => array (
  37. [0] => array(
  38. 'id' => 266,
  39. 'telephone' => 09987 787424
  40. ),
  41. ),
  42. [3] => array(
  43. [0] => array(
  44. 'id' => 33,
  45. 'studentid' => 77942421,
  46. 'schemeofstudy' => 71,
  47. 'childtables' => array(
  48. [4] => array (
  49. [0] => array(
  50. 'id' => 101,
  51. 'projtitle' => Writing a Recursive Function!
  52. )
  53. )
  54. )
  55. )
  56. )
  57. )
  58. )
  59. )
  60.  
  61.  
  62.  
  63. Array Key Tree
  64.  
  65. array (
  66. [0] => array (
  67. [1] => true,
  68. [2] => true,
  69. [3] => array (
  70. [4] => true
  71. )
  72. )
  73. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement