Reply to Re: [PHP] delete part of array

Your name:

Reply:


Posted by Jochem Maas on 09/30/60 11:05

Sebastian wrote:
> how do i delete keys from an array if it has no values?
> eg, this:

what does the value have to do with it??? other than that you want to
remove items where the value is 'empty'.
also 'no value' is vague, do you mean an empty string or do you mean NULL?

---

try the array_values() function, possibly in conjunction with
array_unique() depending on your requirements. look them up in the
manual, while your there read the rest of it as well.

---

I assume you know how to:

1. create an array
2. loop an array
3. check a variable's value is/isn't something in particular
4. assign a value to a variable.

combine these skills! (if you can answer no to any of the above
questions then you need to read the manual - its a good manual, people
have spent countless hours writing - show respect and use it!)

>
> [name] => Array
> (
> [0] => grape
> [1] => apple
> [2] =>
> [3] => orange
> [4] =>
> [5] => cherry
> )
>
> to:
>
> [name] => Array
> (
> [0] => grape
> [1] => apple
> [2] => orange
> [3] => cherry
> )
>

[Back to original 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

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