More on array_pop for PHP3
| From: | Nicolae Doca | Date: | Fri, 06 Oct 2000 09:08:09 +0000 |
| Subject: | More on array_pop for PHP3 | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-2990@lists.php.net to get a copy of this message | ||
This thing still bugs me, so for anyone else that's in a similar situation
here is an PHP3 emulation of the array_pop($array) function:
<?php
function sim_array_pop($arr)
{
end($arr);
list($key) = each($arr);
unset($arr[$key]);
end($arr);
list($key, $val) = each($arr);
return $val;
}
?>
Regards,
Nick