Array function library: Array_unshift

Source: Internet
Author: User
Keywords array_unshift php Chinese function manual array function library
Tags aliyun array array function library array_unshift beginning function function library html

Array_unshift

(PHP4)

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

Syntax: int array_unshift (array array, mixed Var, [...]);

Description:

This function adds the element to the front of the arrays array, which returns the number of new elements in the array.

Example:

<?php

$queue = Array ("P1", "P3");

Array_unshift ($queue, "P4", "P5", "P6");
?>

This example will give the $queue five elements: "P4", "P5", "P6", "P1" and "P3".

Reference: Array_shift () Array_push () Array_pop ()

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.