AW: [PHP-WIN] array_pop
| From: | Jens Wabnitz | Date: | Thu, 05 Oct 2000 17:14:06 +0000 |
| Subject: | AW: [PHP-WIN] array_pop | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-2956@lists.php.net to get a copy of this message | ||
Hi Nicolae,
not tested, but should work.
<?
$arr["one"] = "ha";
$arr[1] = "hmm";
$arr["two"] = "he";
$arr["three"] = "ho";
$max = count($arr);
$cnt =1;
while (list($key, $val) = each($arr))
{
print "$cnt: $key => $val <BR>";
if ($cnt == $max)
{
print $val;
unset($arr[$key]);
}
$cnt++;
}
?>
Bye
Jens