Page 1 of 1

Multidimensional Array

Posted: Mon Jun 05, 2017 3:34 pm
by alla8559
I received this array

array(teste,teste2,teste3, teste4) (or more)

and i need transform in this multidmensional array:

Code: Select all

array(
      'name' => teste,
      'child' => array(
        'name' => 'teste2',
        'child'  => array(
          'name' => 'teste3',
          'child' => array(
            'name' => 'teste4'
          )
        )
      )
    ) 


How i do this?

Re: Multidimensional Array

Posted: Thu Jan 25, 2018 10:28 am
by andr8558
I believe its better if you ask this question at StackOverflow right?