Home > php教程 > php手册 > body text

php在数组开头插入元素函数array_unshift()用法

WBOY
Release: 2016-06-13 11:19:25
Original
1258 people have browsed it

在未知道这个函数前我们要在数据前面插入一些元素觉得很复杂,要利用遍历来操作,要不就插入到后面了,下面我们分享一个实用的array_unshift()函数,它可以解决一切问题。  

先不说什么先看实例

#1 array_unshift() example

 代码如下 复制代码

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template