I am using end() to set the internal pointer of an array to its last element. Then I am using key() to get the key of that last element.
For example:
$array = ('one' => 'fish', 'two' => 'fish', 'red' => 'fish', 'blue' => 'fish');
end($array)
$last_key = key($array);
The only thing that I do not understand is what the internal pointer of an array is exactly. Can someone explain it to me? I've been trying but cannot find an explanation.
Also, how does setting the internal pointer of an array affect that array?