Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

collection laravel Gets the last key of an array

$collection = collect(['key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3']);

dd($collection->reverse()->keys()->first());
 
PREVIOUS NEXT
Tagged: #collection #laravel #Gets #key #array
ADD COMMENT
Topic
Name
6+8 =