It\'s as easy as the title sounds; I need to get the index/key of the last inserted item. Why is this difficult? See the following two code samples:
$a=array
Here is a linear (fastest) solution:
end($a); $last_id=key($a);