PHP 8.5.0 Released!

Voting

: zero plus zero?
(Example: nine)

The Note You're Voting On

Anonymous
13 years ago
Similarly, if you want the last value without affecting the pointer, you can do:
<?php
$array = array("one","two","three");
echo next($array); // "two"
$last = array_pop(array_keys(array_flip($array)));
echo $last; // "three"
echo current($array); // "two"
?>

<< Back to user notes page

AltStyle によって変換されたページ (->オリジナル) /