View Single Post

  #4 (permalink)  
Old 10-15-2006
Pedro Graca
 
Posts: n/a
Default Re: Return value of 'each', 'current', 'next', 'end'

Daz wrote:
>
> Chung Leong wrote:
>> Hermann.Richter@gmail.com wrote:
>> > <?
>> > end($array) ;
>> > current($array)="new value" ;
>> > ?>
>> >
>> > is that posible??

>>
>> end($array);
>> $array[key($array)] = "new value";

>
> $array[(sizeof($array)-1)] ="new value";
> should also work.


<?php
$tmp = array('forty-two'=>42, 'twenty-four'=>24);
echo $array[sizeof($array)-1];
?>

--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot
Reply With Quote