Ok guys... I got a quick array problem. I've spent some time on this and I've about pulled out my hair.
I have a 2D array, that I would like to transform into another 2D array. Such as....
This is what i start with......
$arrayVar[0][id] = 34;
$arrayVar[0][name] = 'bob';
$arrayVar[1][id] = 12;
$arrayVar[1][name] = 'mary';
$arrayVar[2][id] = 6;
$arrayVar[2][name] = 'bob';
$arrayVar[3][id] = 7;
$arrayVar[3][name] = 'jo';
$arrayVar[4][id] = 99;
$arrayVar[4][name] = 'jo';
$arrayVar[5][id] = 73;
$arrayVar[5][name] = 'mary';
$arrayVar[6][id] = 81;
$arrayVar[6][name] = 'bob;
And I want to get this.....
$arrayNew[0][id] = '34, 6, 81';
$arrayNew[0][name] = 'bob';
$arrayNew[0][id] = '12, 73';
$arrayNew[0][name] = 'bob';
$arrayNew[0][id] = '7, 99';
$arrayNew[0][name] = 'bob';
Basically I want all unique names to have all their id's concatenated into one string. Make sense? Anyways, if someone can help I'd be much appreciated, as this has been a pain in the butt. I've tried doing foreach loops, sort, ksort but I always get stuck on the grouping of the ids.
Any and all ideas, functions or suggestions are welcome.
Thanks!!!