Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

key of last element php

//(PHP 7 >= 7.3.0)
$key = array_key_last($data);

//ALL PHP Versions
end($data);         // move the internal pointer to the end of the array
$key = key($data);  // fetches the key of the element pointed to by the internal pointer

 
PREVIOUS NEXT
Tagged: #key #element #php
ADD COMMENT
Topic
Name
4+9 =