Not easy! Best way to clean an array of arrays
- From: "fluk@xxxxxxx" <francesco.campana.76@xxxxxxxxx>
- Date: Fri, 30 May 2008 04:09:07 -0700 (PDT)
Hi Guys, I hope someone can help me with this, because i'm getting
crazy to find a good way to do that!
This is what I got by querying a db.
$arr1 = array("site", "description", "area1" , "activity1");
$arr2 = array("site", "description", "area1" , "activity2");
$arr3 = array("site", "description", "area2" , "activity2");
$arr4 = array("site1", "description1", "area3" , "activity2");
$my_array = array($arr1, $arr2, $arr3, $arr4);
Site and description are linked because they are in the same row of
the same table.
But every site can have 1 or more areas and every area can have 1 or
more activity.
I'd like to clean $my_array in a way I can have a compact one without
doubles
//pseudocode!
$new = array (
array('site','descr') => array (
array('area','activity')
)
);
Is it possible??
Thanks for your precious help
Francesco
.
- Follow-Ups:
- Re: Not easy! Best way to clean an array of arrays
- From: Jerry Stuckle
- Re: Not easy! Best way to clean an array of arrays
- Prev by Date: Re: asp.net to PHP
- Next by Date: Re: Not easy! Best way to clean an array of arrays
- Previous by thread: GD, IMagick and Chinese words in utf-8
- Next by thread: Re: Not easy! Best way to clean an array of arrays
- Index(es):
Relevant Pages
|