$example = array('First','Second','Third','Fourth','Fifth',...
The code below will unset the third element in $example.
unset($example[2]);
How can I unset all of the elements past the third element?
I want $example‘s value to be this afterwards:
$example = array('First','Second','Third');
Don’t use unset, use array_splice: