Lets suppose i have the following array submitted by a html form:
array(
'firstname' => array('Sara','Jim'),
'lastname' => array('Gibson','Jobs')
);
What i wanna achieve is the following array:
array(
array(
'firstname' => 'sara',
'lastname' => 'Gibson'
),
array(
'firstname' => 'Jim',
'lastname' => 'Jim'
)
);
I need a function to automatically sort the array not manually by entering data but automatically processing array data.
I don’t see anything wrong with @Tim Cooper’s solution, but if you don’t want to mention the keys manually, you can also use: