Get last key-value pair in PHP array -


i have array structured this:

[33] => array     (         [time] => 1285571561         [user] => test0     )  [34] => array     (         [time] => 1285571659         [user] => test1     )  [35] => array     (         [time] => 1285571682         [user] => test2     ) 

how can last value in array, maintaining index [35]?

the outcome looking this:

[35] => array     (         [time] => 1285571682         [user] => test2     ) 

try use

end($array); 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -