Array function library: Array_push

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

Array_push

(PHP4)

Array_push---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Add one or more elements to the end of the array

Syntax: int array_push (array array, mixed var [, mixed ...]);

Description:

This function considers the parameter array to be a stack (stack), and the extension variable is above the end of the parameter array, and the length of the parameter array increases according to the number of variables.

The same effect is:

<?php

$array [] = $var;

?>

Repeats each var.

Returns the new number of elements in the array.

Example:

<?php

$stack = Array (1, 2);

Array_push ($stack, "+", 3);

?>

This Fan Lee will allow the $stack to have four elements: 1, 2, "+" and 3

Reference: Array_pop () Array_shift () Array_unshift ()

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.