I've searched how to push both key and value and I found this : How to push both value and key into array
But my question is how to add more than one key and value into an array?
$somearray
:
Array (
[id] => 1645819602
[name] => Michael George)
I want to add this into $somearray
:
[first_name] => Michael
[last_name] => George
[work] => Google
So the output will be
Array (
[id] => 1645819602
[name] => Michael George
[first_name] => Michael
[last_name] => George
[work] => Google)
I know this code will not work
$arrayname[first_name] = Michael;
$arrayname[last_name] = George;
$arrayname[work] = Google;
Any help would be greatly appreciated. Thank you