PHP key() 函数

PHP 教程 · 2019-01-22 19:43:10

实例

从当前内部指针位置返回元素键名:

<?php
$people=array("Peter","Joe","Glenn","Cleveland");
echo "The key from the current position is: " . key($people);
?>

定义和用法

key() 函数从当前内部指针位置返回元素键名。

如果错误,函数返回 FALSE。

语法

key(array)

参数 描述
array 必需。规定要使用的数组。

技术细节

返回值: 返回当前内部指针所指向的数组元素的键名。
PHP 版本: 4+

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

查看所有标签

Boolean Reasoning

Boolean Reasoning

Brown, Frank Markham / 2003-4 / $ 19.15

A systematic treatment of Boolean reasoning, this concise, newly revised edition combines the works of early logicians with recent investigations, including previously unpublished research results. Th......一起来看看 《Boolean Reasoning》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具