$arr = (a => array(1,2,3), b => array(1,2,3), c => array(4,5), d=> array(8,9,10), e => array(8,9), f => array(9,10);
I would like to merge similar values, so that I would get:
- Problem #1 (similar values, harder):
$new_arr = (a_b => array(1,2,3), c => (4,5), d_e_f => array(8,9,10));
- Problem #2 (exactly same values, easier):
$new_arr = (a_b => array(1,2,3), c => (4,5), d => array(8,9,10), e => array(8,9), f => array(9,10));
What's the most effective way to to the above?? May be a hard question to solve :D
Thanks!
array_uniquethat works with arrays, but doesn't createa_bkey names) is in the User Contributed Notes to array_unique: php.net/manual/en/function.array-unique.php#97285