Reformat a simple PHP array

hemo-knight

New Member
How do I go about reformatting an object?\[code\]Array( [0] => Array ( [user_id] => 5 [first_name] => Ace [last_name] => Black ) [1] => Array ( [user_id] => 6 [first_name] => Gary [last_name] => Surname ) [2] => Array ( [user_id] => 7 [first_name] => Alan [last_name] => Person ))\[/code\]I need to reformat this so the user_id name is changed to just 'id' and the first_name and last_name values are merged into a single value called 'name' so the final result would look like:\[code\]Array( [0] => Array ( [id] => 5 [name] => Ace Black ))\[/code\]
 
Back
Top