International PHP Conference Munich 2025

Voting

: max(nine, five)?
(Example: nine)

The Note You're Voting On

guillaume dot lacourt at gmail dot com
9 years ago
Using array_splice when you traverse array with internal pointer's function reset the array, eg:

<?php
end
($arrOfData);
$last = key($arrOfData);
reset($arrOfData);
while ((
$data = current($arrOfData))) {
if (
$last === key($arrOfData)) {
array_splice($arrOfData, $last, 1);
// current($arrOfData) => first value of $arrOfData
}
}

<< Back to user notes page

To Top