I have two arrays like this:
$array1 = [
[10, 'Some Name..'],
[11, 'Some Name..'],
[13, 'Some Name..'],
];
$array2 = [
[13, 'Viewed']
];
How can I merge these two arrays without looping? Is there any php functionality available for this? I need this kind of output:
[
[10, 'Some Name..'],
[11, 'Some Name..'],
[13, 'Some Name..', 'Viewed']
]
You can use the PHP function array_merge_recursive.
See the example: