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://codercto.com/courses/l/5.html

查看所有标签

Squid: The Definitive Guide

Squid: The Definitive Guide

Duane Wessels / O'Reilly Media / 2004 / $44.95 US, $65.95 CA, £31.95 UK

Squid is the most popular Web caching software in use today, and it works on a variety of platforms including Linux, FreeBSD, and Windows. Squid improves network performance by reducing the amount of......一起来看看 《Squid: The Definitive Guide》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

在线进制转换器
在线进制转换器

各进制数互转换器