function filter_by_value($array, $index, $value){
if (is_array($array) && count($array) > 0) {
foreach(array_keys($array) as $key){
if (isset($array[$key][$index])) {
$temp[$key] = $array[$key][$index];
if ($temp[$key] == $value){
$newarray[] = $key;
}
}
}
}
return $newarray;
}
$keys = filter_by_value($trik, 'name_g', $t['name_g']);