I have the array:
$array = Array(
[0] => Array(
[Branch] => 'Toyota',
[Country] => 'Jpn',
[id] => 'jp01'
)
[1] => Array(
[Branch] => 'Nissan',
[Country] => 'Jpn',
[id] => 'jp05'
)
[2] => Array(
[Branch] => 'Honda',
[Country] => 'Jpn',
[id] => 'jp20'
) )
What I want to do is:
1 - Change the key Branch
to Brand
, but without moving it to the end or the array.
2 - Update all the values to the key Country, changing Jpn
to Japan
The result should be like this:
$array = Array(
[0] => Array(
[Brand] => 'Toyota',
[Country] => 'Japan',
[id] => 'jp01'
)
[1] => Array(
[Brand] => 'Nissan',
[Country] => 'Japan',
[id] => 'jp05'
)
[2] => Array(
[Brand] => 'Honda',
[Country] => 'Japan',
[id] => 'jp20'
) )
I really appreciate your help.