You are here: Re: [PHP] another simple array question « PHP « IT news, forums, messages
Re: [PHP] another simple array question

Posted by David Grant on 11/18/05 16:00

if (isset($values[4])
unset($values[4]);

Cheers,

David Grant

cybermalandro cybermalandro wrote:
> I have an array with indexes 0 to 4 and I want to delete an element of the
> array if the index is equals 4. I want to delete the variable key and value.
> What is the best way to do so?
>
> foreach ($values as $key => $val){
>
> if ($key == "0") {
> //
> }
> if ($key == "3") {
> //
> }
> if ($key == "4") {
> //delete value from array
>
> }
> }
>
> Thanks!!!!!
>

 

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

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