PHP linear table push and pop example analysis, PHP linear table example analysis_PHP tutorial

WBOY
Release: 2016-07-13 09:51:00
Original
865 people have browsed it

Example analysis of pushing and popping PHP linear tables into the stack, PHP linear table case analysis

The examples in this article describe the usage of PHP linear tables being pushed into and popped out of the stack. Share it with everyone for your reference. The details are as follows:

<&#63;php 
$stack = array("Simon", "Elaine"); //定义数组 
array_push($stack, "Helen", "Peter"); //入栈 
print_r($stack); 
&#63;>
Copy after login
<&#63;php 
$stack = array("Simon", "Elaine"); //定义数组 
array_unshift ($stack, "Helen", "Peter"); //入栈 
print_r($stack); 
&#63;>
Copy after login
<&#63;php 
$stack = array("Simon", "Elaine", "Helen", "Peter"); 
echo array_pop($stack)."/n"; //出栈 
print_r($stack); 
&#63;>
Copy after login
<&#63;php 
$stack = array("Simon", "Elaine", "Helen", "Peter"); 
echo array_shift($stack)."/n"; //出栈 
print_r($stack); 
&#63;>
Copy after login

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1015427.htmlTechArticleExample analysis of pushing and popping php linear tables into the stack, php linear table example analysis This article tells the example of php linear tables Pushing and popping usage. Share it with everyone for your reference. The details are as follows: p...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template