-1

i have this items in array

Array ( [0] => Array ( [0] => 0001 [1] => 1 [2] => 123456789 ) [1] => Array ( [0] => 0000 [1] => 1 [2] => 011155555 ) )

so, now i want to find 0000 and 011155555 and if they exist to delete that position where they exist.

i cant figure it out how to check if both criteria exist in array. I tried with 'array_search' but i dont know how to search both criteria in array.

so it should be something like that:

if 0000 and 011155555 exist in array, remove that position

AbraCadaver
  • 73,820
  • 7
  • 55
  • 81
gandrap
  • 139
  • 1
  • 11

1 Answers1

5

This is my second array_filter() today:

$result = array_filter($array, function($v) {
                                    return !(in_array('0000', $v) &&
                                             in_array('011155555', $v));
                               });
AbraCadaver
  • 73,820
  • 7
  • 55
  • 81