Array (
[0] => Array (
[0] => a
[1] => b
[2] => c
[3] => c
[4] => d
)
)
I have 2D array as of $arr[0][$i];
$i is the only part that increments, whereas 0 is fixed.
1. I need to remove element a and b via a search inside the array.
My attempt did not delete the elements:
$posts = array_diff($posts, array("a", "b"));
2. I would like to eliminate all duplicated values and leave only one i.e. removing all c’s except one c.
The final output would be:
Array (
[0] => Array (
[0] => c
[1] => d
)
)
I’m trying to figure it out, however, your help will be very much appreciated.
if you select the inner array it should work as you aspect it
The elimination should work that way