key of last element php

Solutions on MaxInterview for key of last element php by the best coders in the world

showing results for - "key of last element php"
Giulia
05 Jul 2019
1//(PHP 7 >= 7.3.0)
2$key = array_key_last($data);
3
4//ALL PHP Versions
5end($data);         // move the internal pointer to the end of the array
6$key = key($data);  // fetches the key of the element pointed to by the internal pointer
7
8