You are here: Re: Return value of 'each', 'current', 'next', 'end' « PHP Programming Language « IT news, forums, messages
Re: Return value of 'each', 'current', 'next', 'end'

Posted by Chung Leong on 10/14/06 19:09

Hermann.Richter@gmail.com wrote:
> These array functions: 'each', 'current', 'next', 'end'
>
> They return a reference or a value.

They return values.

> let's say I want to modify the last value of an array without iterating
> through all of them.
>
> I would do:
>
> <?
> end($array) ;
> current($array)="new value" ;
> ?>
>
> is that posible??

Try

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация