Multidimensional Array

General discussion on PHP
Post Reply
alla8559
Posts: 2
Joined: Mon Jun 05, 2017 12:23 am

Multidimensional Array

Post by alla8559 » Mon Jun 05, 2017 3:34 pm

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?

andr8558
Posts: 19
Joined: Thu Jan 11, 2018 5:45 pm

Re: Multidimensional Array

Post by andr8558 » Thu Jan 25, 2018 10:28 am

I believe its better if you ask this question at StackOverflow right?

Post Reply