PHP array_pop() 函数

PHP 教程 · 2019-01-22 11:26:44

实例

删除数组中的最后一个元素:

<?php
$a=array("red","green","blue");
array_pop($a);
print_r($a);
?>

定义和用法

array_pop() 函数删除数组中的最后一个元素。

语法

array_pop(array)

参数 描述
array 必需。规定数组。

技术细节

返回值: 返回数组的最后一个值。如果数组是空的,或者不是一个数组,将返回 NULL。
PHP 版本: 4+

点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Weaving the Web

Weaving the Web

Tim Berners-Lee / Harper Paperbacks / 2000-11-01 / USD 15.00

Named one of the greatest minds of the 20th century by Time , Tim Berners-Lee is responsible for one of that century's most important advancements: the world wide web. Now, this low-profile genius-wh......一起来看看 《Weaving the Web》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具