note 90772 deleted from function.key by danbrown
| From: | danbrown@php.net | Date: | Fri, 08 May 2009 23:04:09 +0000 |
| Subject: | note 90772 deleted from function.key by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154379@lists.php.net to get a copy of this message | ||
Note Submitter: kyle dot florence [@t] gmail dot com
----
Prettier version of Michael's function:
<?php
// Returns the key from an array index (index can be negative)
function index_key($array, $index)
{
return key(array_slice($array, $index, 1));
}
?>