views:

38

answers:

2

alt text

In the screenshot, you can see i have an array of arrays. I need to find an array that contains say, 'Russia', and unset it completely. That is, for Russia, remove the element [303].

I've played around with array search but I'm sure theres a funkier way of doing this.

Chris.

+3  A: 
$array = your array;
foreach ($array as $key => $value) {
   if ($value['countryName'] == 'Russia') {
      unset($array[$key]);
   }
}
Alexander.Plutov
A: 

and if you want reorder the key , you could use:

$new_array = array_values($array);
coolkid