PHP array_values() 函数

PHP 教程 · 2019-01-22 16:41:29

实例

返回数组中所有的值(不保留键名):

<?php
$a=array("Name"=>"Peter","Age"=>"41","Country"=>"USA");
print_r(array_values($a));
?>

定义和用法

array_values() 函数返回包含数组中所有的值的数组。

提示:被返回的数组将使用数值键,从 0 开始且以 1 递增。

语法

array_values(array)

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

技术细节

返回值: 返回包含数组中所有的值的数组。
PHP 版本: 4+

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

查看所有标签

Pro Git

Pro Git

Scott Chacon / Apress / 2009-8-27 / USD 34.99

Git is the version control system developed by Linus Torvalds for Linux kernel development. It took the open source world by storm since its inception in 2005, and is used by small development shops a......一起来看看 《Pro Git》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

html转js在线工具
html转js在线工具

html转js在线工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换