Get array's key recursively and create underscore seperated string.

Posted by Nehal on Stack Overflow See other posts from Stack Overflow or by Nehal
Published on 2010-05-01T09:16:52Z Indexed on 2010/05/01 9:17 UTC
Read the original article Hit count: 242

Filed under:
|
|

Hello Everyone,

Right now i got an array which has some sort of information and i need to create a table from it. e.g.

Student{
      [Address]{
              [StreetAddress] =>"Some Street"
              [StreetName] => "Some Name"
      }
      [Marks1] => 100
      [Marks2] => 50
    }

Now I want to create database table like which contain the fields name as :

Student_Address_StreetAddress
Student_Address_StreetName
Student_Marks1
Student_Marks2

It should be recursive so from any depth of array it can create the string in my format.

© Stack Overflow or respective owner

Related posts about php

Related posts about multidimensional