$example =
array
\'test\' =>
array(
\'something\' => \'value\'
),
\'whatever\' =>
array(
\'something\' => \'othe
array_filter() is what you need:
count(array_filter($example, function($element){
return $element['something'] == 'other';
}));
In case you want to be more flexible:
$key = 'something';
$value = 'other';
$c = count(array_filter($example, function($element) use($key, $value){
return $element[$key] == $value;
}));
You can try the following:
$count = 0;
foreach( $example as $value ) {
if( in_array("other", $value ) )
$count++;
}