Ive worked on this so long that I must be over complicating a simple solution.
Given the following in arrays
$in_num = array('a'=>1, 'b'=>1, 'c'=>2, 'd'=>1, 'e'=>2, 'f'=>2, 'g'=>2, 'h'=>2);
$in_str = array('a'=>'a', 'b'=>'a', 'c'=>'b', 'd'=>'a', 'e'=>'b', 'f'=>'b', 'g'=>'b);
Desired output
$out_num = array('a'=>1, 'c'=>2, 'd'=>1, 'e'=>2);
$out_str = array('a'=>'a', 'c'=>'b', 'd'=>'a', 'e'=>'b');
The Key order must be maintained.
array('a'=>1, 'b'=>'str') does NOT occur.
Sure would appreciate your help.