You are here: Re: [PHP] delete part of array « PHP « IT news, forums, messages
Re: [PHP] delete part of array

Posted by Tatang Widyanto on 10/04/25 11:05

Sebastian wrote:
> how do i delete keys from an array if it has no values?
> eg, this:
>
> [name] => Array
> (
> [0] => grape
> [1] => apple
> [2] =>
> [3] => orange
> [4] =>
> [5] => cherry
> )
>
> to:
>
> [name] => Array
> (
> [0] => grape
> [1] => apple
> [2] => orange
> [3] => cherry
> )
>

foreach ($name as $value) {
if ($value)
$buffer[] = $value;
}

$name = $buffer;

 

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

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