Skip to content

Instantly share code, notes, and snippets.

@muhtarudinsiregar
Created April 7, 2017 09:32
Show Gist options
  • Select an option

  • Save muhtarudinsiregar/bc73693f02206c5c03cb1bd6ad3658c8 to your computer and use it in GitHub Desktop.

Select an option

Save muhtarudinsiregar/bc73693f02206c5c03cb1bd6ad3658c8 to your computer and use it in GitHub Desktop.
Case Study 14
<!-- merge multidimensional array -->
$users = [
[
'id' => 1,
'name' => 'Adimas Lutfi Wicaksono',
],
[
'id' => 2,
'name' => 'Salman Alfarisi',
],
[
'id' => 3,
'name' => 'Muhammad Sholeh',
],
];
$users_new = [
[
'id' => 4,
'name' => 'Yadi Cahyadi',
],
[
'id' => 5,
'name' => 'Maya Maulani',
],
];
print_r(array_merge($users, $users_new));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment