@ 2015-12-09T04:27:08Z <?php
$arr = [
0 => [
'id' => 123-456-000-000,
'name' => 'john'
],
1 => [
'id' => 123-456-789-014,
'name' => 'james'
]
];
$arr1 = [
0 => [
'id' => 123-456-000-000,
'address' => 'Japan'
],
1 => [
'id' => 123-456-789-014,
'address' => 'Spain'
]
];
foreach ($arr1 as $key => $inner) {
$arr1[$key]["address"] = $inner["address"];
}
print_r(arr1);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.7 Fatal error: Uncaught Error: Undefined constant "arr1" in /in/N781T:32
Stack trace:
#0 {main}
thrown in /in/N781T on line 32
Process exited with code 255 . Output for 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 Warning: Use of undefined constant arr1 - assumed 'arr1' (this will throw an Error in a future version of PHP) in /in/N781T on line 32
arr1 Output for 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 , 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 Notice: Use of undefined constant arr1 - assumed 'arr1' in /in/N781T on line 32
arr1 preferences:dark mode live preview
209.31 ms | 402 KiB | 330 Q