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);
?>
$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
Ruby on Rails Tutorial
Michael Hartl / Addison-Wesley Professional / 2012-8-6 / USD 44.99
"Ruby on Rails(TM) Tutorial by Michael Hartl has become a must-read for developers learning how to build Rails apps." -Peter Cooper, Editor of Ruby Inside Using Rails, developers can build web applica......一起来看看 《Ruby on Rails Tutorial》 这本书的介绍吧!