Get the final key of an array in PHP
- by GSto
I have a standard associative array in PHP. what's the simplest way to get the last key in that array?
example:
$foo = array('key1' => 'val1', 'key2' => 'val2', 'key3' => 'val3');
and i would like to get 'key3';