Yngvarr

Generation

generate functionSat, 07 Jan 2023

get last value from array

function getLastItem($array) { return $array[count($array) - 1]; } getLastItem([1, 2, 3]); // 3

Questions about programming?Chat with your personal AI assistant