Arrays zusammenführen in PHP
array_mergearray_combineЗадание 1
Gegeben sind Arrays:
php<?php
$arr1 = [1, 2, 3];
$arr2 = ['a', 'b', 'c'];
?>
Erstellen Sie daraus ein Array:
php<?php
[1, 2, 3, 'a', 'b', 'c']
?>
Задание 2
Gegeben sind Arrays:
php<?php
$arr1 = ['a', 'b', 'c'];
$arr2 = [1, 2, 3];
?>
Erstellen Sie mit deren Hilfe das folgende Array:
php<?php
['a' => 1, 'b' => 2, 'c' => 3]
?>