Array function library: Array_merge

Source: Internet
Author: User
Keywords array_merge php Chinese function manual array function library
Tags aliyun array array function library array_merge function function library html http

Array_merge

(PHP4)

Array_merge---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Merging more than two arrays

Syntax: array array_merge (array array1, array array2 [, array ...]);

Description:

This function combines more than two numbers together so that their values are appended to the previous one. If the input array has the same string index value, the later value will overwrite the previous value, however, the array has the same numeric index, but subsequent values will not overwrite the original value, but will be appended.

Example:

<?php

$array 1 = Array ("Color" => "Red", 2, 4);

$array 2 = Array ("A", "B", "Color" => "green", "shape" => "trapezoid");

Array_merge ($array 1, $array 2);

?>

The resulting arrays will be array ("Color" => "green", 2, 4, "A", "B", "Shape" => "trapezoid")

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.