any idea how if the following is possible in PHP as a single line ?:
... It doesn
You can use array_slice(), like so:
array_slice()
$elementX = array_slice(functionThatReturnsAnArray(), $x, 1);
Also noticed that end() is not mentioned. It returns the last element of an array.
end()