You are here: Re: foreach / unset « PHP « IT news, forums, messages
Re: foreach / unset

Posted by Bogdan Ribic on 10/08/76 11:30

Richard Lynch wrote:

>
> Anyway, can you do *this* safely as a DOCUMENTED FEATURE:
>
> foreach($array as $k => $v){
> if (...) unset($array[$k]);
> }
>

Well, somewhere in the said manual it is written that foreach operates
on a *copy* of the array, so you should be safe unsetting values in the
original array while iterating through the copy.

--

Open source PHP code generator for DB operations
http://sourceforge.net/projects/bfrcg/

 

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

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