You are here: Re: Multidimensional array remove values « PHP Programming Language « IT news, forums, messages
Re: Multidimensional array remove values

Posted by Aggelos on 02/13/07 13:54

On Feb 13, 1:15 am, "Chuy08" <chu...@yahoo.com> wrote:
> If I have a multdimensional array like so:
>
> $records = array(
> array('product' => '30 year','rate'=> 6.0 'ProgramID' =>9514),
> array('product' => '30 year','rate'=> 6.0 'ProgramID' =>9514),
> array('product' => '30 year','rate'=> 6.0 'ProgramID' =>9517),
> array('product' => 'Pay option','rate'=> 1.0 'ProgramID' =>9513),
> array('product' => 'Pay option','rate'=> 1.0 'ProgramID' =>9513));
>
> How could I iterate through this and removing only values that are
> duplicated by ProgramID. In this example the new array should contain only
> the 1st, 3rd and 4th values. Any help appreciated.
>
> chuy
>
> --
> Posted via a free Usenet account fromhttp://www.teranews.com
I won't suggest a sollution to what you are asking.
I'll tell you to try and fix the problem in a lower level.
How is this array gennerated ?

The vlaues that are Dups shoul be used as primary keys.

So create something like that $record[$productId][$rate][$programId]

That's how I work... it makes more sense from a Relational point of
view.

 

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

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