I have an issue to remove duplicates entries from three different array. Let me create the structure of an array.
array (
'table_id' =>
array (
1 => '1',
2 => '1',
3 => '1',
4 => '1',
5 => '1',
6 => '1',
7 => '1',
8 => '1', <-- This entry have value '1' :
14 => '1',
17 => '1',
20 => '1', <-- This entry have value '1' :
21 => '1',
25 => '1',
28 => '1', <-- This entry have value '1' :
),
'no_of_seats' =>
array (
1 => '2',
2 => '2',
3 => '2',
4 => '2',
5 => '2',
6 => '4',
7 => '4',
8 => '4', <-- This entry have value '4' :
14 => '8',
17 => '2',
20 => '4', <-- This entry have value '4' :
21 => '8',
25 => '6',
28 => '4', <-- This entry have value '4' :
),
'dt_time_slot' =>
array (
1 => '4:30',
2 => '6:30',
3 => '9:00',
4 => '17:00',
5 => '23:00',
6 => '0:30',
7 => '1:30',
8 => '4:30', <-- This entry have value '4:30' :
14 => '4:00',
17 => '19:00',
20 => '4:30', <-- This entry have value '4:30' :
21 => '6:30',
25 => '7:30',
28 => '4:30', <-- This entry have value '4:30' :
));
the resulted array should be:
array (
'table_id' =>
array (
1 => '1',
2 => '1',
3 => '1',
4 => '1',
5 => '1',
6 => '1',
7 => '1',
8 => '1', <-- This entry have value '1' :
14 => '1',
17 => '1',
21 => '1',
25 => '1',
),
'no_of_seats' =>
array (
1 => '2',
2 => '2',
3 => '2',
4 => '2',
5 => '2',
6 => '4',
7 => '4',
8 => '4', <-- This entry have value '4' :
14 => '8',
17 => '2',
21 => '8',
25 => '6',
),
'dt_time_slot' =>
array (
1 => '4:30',
2 => '6:30',
3 => '9:00',
4 => '17:00',
5 => '23:00',
6 => '0:30',
7 => '1:30',
8 => '4:30', <-- This entry have value '4:30' :
14 => '4:00',
17 => '19:00',
21 => '6:30',
25 => '7:30',
));
What is real duplicate means that all three different array have same keys like 1,2,3,....14,....25. what i want that same key from three arrays should not contain same value...if they contain same then i marked it as duplicates..
What I want is to remove duplicate entries from the three different array (duplicate entries can be greater than 3. This time its 3.) and keep only one value.
Please let me know how can I do that.