I'd like to get last element of an array in PHP.
I often do this:
$last = $this->array_of_stuff[count($this->array_of_stuff) - 1];
I'm not very happy with that though.
Any way to make the syntax shorter and avoid repeating code?
foreach for example. Otherwise it's safe, but check the manual for better understanding
end(). Your question might fall in the "does not show any research effort" box for some voters