📌  相关文章
📜  获取最后一个元素的键 php 代码示例

📅  最后修改于: 2022-03-11 14:53:49.825000             🧑  作者: Mango

代码示例1
//(PHP 7 >= 7.3.0)
$key = array_key_last($data);

//ALL PHP Versions
end($data);         // move the internal pointer to the end of the array
$key = key($data);  // fetches the key of the element pointed to by the internal pointer