I have a list that gets new rows from time to time, but I get it as a string. What I want to do is first separate each row, and insert it into an associative array. I'll show you some examples.
The string I receive looks something like this:
id1 name1 lastname1 age1 birthdate1
id2 name2 lastname2 age2 birthdate2
id3 name3 lastname3 age3 birthdate3
id4 name4 lastname4 age4 birthdate4
I need to separate each "row" and "column" and insert it into an associative array. So basically something like:
array{
id1{
'name' => 'name1',
'lastname' => 'lastname1',
'age' => 'age1',
'birthdate' => 'birthdate1'
},
id2{
'name' => 'name2',
'lastname' => 'lastname2',
'age' => 'age2',
'birthdate' => 'birthdate2'
},
id3{
'name' => 'name3',
'lastname' => 'lastname3',
'age' => 'age3',
'birthdate' => 'birthdate3'
},
id4{
'name' => 'name4',
'lastname' => 'lastname4',
'age' => 'age4',
'birthdate' => 'birthdate4'
}
}
I hope the examples make my goal more understandable.
Thanks!