I have got several or an amount of arrays which cannot be foreseen. I want to access them und change their keys. I guess with a loop.
Array
(
[count] => 1
[0] => Max, Mustermann
[1] => Job
[2] => Companyname
[3] => IT
[4] => CEO
[5] => N610-611
[6] => +49 (30) 111111
[7] => +49 (30) 111111
[8] => max@company.de
)
Array
(
[count] => 1
[0] => Alicia Keys
[1] => Job
[2] => Companyname
[3] => IT
[4] => CEO
[5] => N610-N611
[6] => +49 11111
[7] => +49 11111
[8] => alikey@company.de
)
I'd like to have an output like this:
Array
(
[count] => 1
[Name] => Max, Mustermann
[Jobname] => Job
[Company] => Companyname
[Division] => IT
[CEO] => CEO
[Room] => N610-611
[Tel] => +49 (30) 111111
[Fax] => +49 (30) 111111
[E-Mail] => max@company.de
)
Array
(
[count] => 1
[Name] => Alicia Keys
[Job] => Job
[Company] => Companyname
[Division] => IT
[CEO] => CEO
[Room] => N610-N611
[Tel] => +49 11111
[Fax] => +49 11111
[E-Mail] => alikey@company.de
)
I'm not sure whether to use a foreach oder a for loop, or if a loop is even necessary. I know that changing keys is not that simple and read of a second array which holds the keys you want to change to. But I'm not sure how to do that