PHP key() 函数
实例
从当前内部指针位置返回元素键名:
<?php
$people=array("Peter","Joe","Glenn","Cleveland");
echo "The key from the current position is: " . key($people);
?>
运行实例 »
定义和用法
key() 函数从当前内部指针位置返回元素键名。
如果错误,函数返回 FALSE。
从当前内部指针位置返回元素键名:
<?php
$people=array("Peter","Joe","Glenn","Cleveland");
echo "The key from the current position is: " . key($people);
?>
key() 函数从当前内部指针位置返回元素键名。
如果错误,函数返回 FALSE。