I want to extract values from an array depending on a value.
- From: SM <servandomontero@xxxxxxxxx>
- Date: Sun, 23 Nov 2008 21:51:54 -0800 (PST)
Hello,
I want to extract values from an array depending on a value.
Here's a similar model how my array looks like:
$doc = array(
'4fwef'=>array(1, 'title'),
'refge'=>array(1, 'title'),
'rh4we'=>array(1, 'title'),
'XXXXX'=>array(2, 'title'),
'wlrei5'=>array(2, 'title'),
'rywerg'=>array(3, 'title'),
'eqrmyu'=>array(3, 'title'),
'uymsr'=>array(3, 'title'),
'y555UT'=>array(4, 'title'),
'8roXDw'=>array(4, 'title'),
't556yt'=>array(5, 'title'),
'MYaGGQ'=>array(6, 'title'),
'8h458r'=>array(6, 'title'),
'57rghq'=>array(6, 'title'),
'2w7enm'=>array(6, 'title'),
'89qern'=>array(7, 'title'),
'85trnn'=>array(7, 'title'),
'1587nr'=>array(8, 'title'),
'83wrr1'=>array(9, 'title')
);
It's multidimensional array.
if you look at this line:
'4fwef'=>array(1, 'title'),
'4fwef' represents the unique key string. 1, represent a category.
'title', represents a short description.
How do i grab/extract all the $docs with similar categories?
i.e
if category = 7, the documents that i want to extract are:
'89qern'=>array(7, 'title'),
'85trnn'=>array(7, 'title'),
if category = 6, then the extraction should give me:
'MYaGGQ'=>array(6, 'title'),
'8h458r'=>array(6, 'title'),
'57rghq'=>array(6, 'title'),
'2w7enm'=>array(6, 'title'),
and so on....
How do i achieve that using the most efficient and fastest method?
Thanks
Marco
.
- Follow-Ups:
- Re: I want to extract values from an array depending on a value.
- From: trookat
- Re: I want to extract values from an array depending on a value.
- From: Jerry Stuckle
- Re: I want to extract values from an array depending on a value.
- From: Jonathan Stein
- Re: I want to extract values from an array depending on a value.
- From: Geoff Berrow
- Re: I want to extract values from an array depending on a value.
- Prev by Date: Re: extra spaces
- Next by Date: Re: I want to extract values from an array depending on a value.
- Previous by thread: extra spaces
- Next by thread: Re: I want to extract values from an array depending on a value.
- Index(es):
Relevant Pages
|