Multidimensional Array

General discussion on PHP

Multidimensional Array

Postby alla8559 on 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?
alla8559
 
Posts: 2
Joined: Mon Jun 05, 2017 12:23 am

Re: Multidimensional Array

Postby andr8558 on Thu Jan 25, 2018 10:28 am

I believe its better if you ask this question at StackOverflow right?
andr8558
 
Posts: 22
Joined: Thu Jan 11, 2018 5:45 pm


Return to PHP

Who is online

Users browsing this forum: No registered users and 1 guest