Re: [PHP] joining array values

2005-05-12 Thread Brent Baisley
You're losing me hear without sample data, but I'll try. Ideally your input array would be something like: $result[] = array('id'=>23, 'text'=>'ok', 'relevance'=>2); $result[] = array('id'=>42, 'text'=>'joel', 'relevance'=>1); $result[] = array('id'=>23, 'text'=>'php', 'relevance'=>1); Which gives

Re: [PHP] joining array values

2005-05-12 Thread Jochem Maas
Merlin wrote: Brent Baisley wrote: Use the id number as the array key and a simple loop should join everything together. for($i=0; $i $id = $result['id'][$i]; $text = $result['text'][$i]; $relevance = $result['relevance'][$i]; $resultSummary[$id]['id'] = $id; if ( isset($re

Re: [PHP] joining array values

2005-05-12 Thread Merlin
Brent Baisley wrote: Use the id number as the array key and a simple loop should join everything together. for($i=0; $i $id = $result['id'][$i]; $text = $result['text'][$i]; $relevance = $result['relevance'][$i]; $resultSummary[$id]['id'] = $id; if ( isset($resultSummary[$

Re: [PHP] joining array values

2005-05-12 Thread Brent Baisley
Use the id number as the array key and a simple loop should join everything together. for($i=0; $i $id = $result['id'][$i]; $text = $result['text'][$i]; $relevance = $result['relevance'][$i]; $resultSummary[$id]['id'] = $id; if ( isset($resultSummary[$id]['text']) ) { $resultSummary[$id][