..
Array_merge function is used to join two or more arrays into a new array. Here's an example:
$ Fruits = array ('apple', 'pear', 'fishing');
$ Vegetables = array ('carrot', 'tomato', 'potato');
/ / Join the two arrays
$ Spent = array_merge ($ fruits, $ vegetables);
The result will be a new array with six elements.
$ Arr1 = array ('a' => 'apple', 'b' => 'pear');
$ Arr2 = array ('b' => 'carrot', 'c' => 'tomato');
print_r (array_merge ($ arr1, $ arr2));
This will output:
Array ( [A] => apple [B] => carrot [C] => tomato )
| |
Linux (Course)
Complete guide to open-source system. From 49 €. |
| |
MySQL (Course)
Management of open-source database. From 39 €. |
| |
PHP (Course)
Full course for creating dynamic Web sites. From 49 €. |