Estoy trabajando con un array como el siguiente:
array(
[RECORD] => Array ( [0] => 276 [1] => 277 [2] => 278 [3] => 279 [4] => 280 [5] => 281 [6] => 282 [7] => 283 [8] => 284 [9] => 285 [10] => 286 [11] => 287 [12] => 288 [13] => 289 [14] => 290 [15] => 291),
[PTemp_C_Avg] => Array ( [0] => 7.261 [1] => 7.215 [2] => 7.218 [3] => 7.305 [4] => 7.499 [5] => 7.801 [6] => 8.21 [7] => 8.67 [8] => 9.17 [9] => 9.7 [10] => 10.28 [11] => 10.91 [12] => 11.57 [13] => 12.28 [14] => 13.09 [15] => 13.96),
[T0_10cm_Avg] => Array ( [0] => 21.32 [1] => 21.18 [2] => 21.07 [3] => 20.54 [4] => 20.61 [5] => 20.92 [6] => 20.16 [7] => 20.26 [8] => 20.39 [9] => 20.49 [10] => 20.05 [11] => 20.29 [12] => 20.7 [13] => 20.82 [14] => 20.27 [15] => 20.47),
[T0_10cm_Max] => Array ( [0] => 25.47 [1] => 27.68 [2] => 26.18 [3] => 27.44 [4] => 25.63 [5] => 26.31 [6] => 27.69 [7] => 26.4 [8] => 25.64 [9] => 26.6 [10] => 24.95 [11] => 26.47 [12] => 25.59 [13] => 24.71 [14] => 26.27 [15] => 26.03),
[T0_10cm_Min] => Array ( [0] => 15.98 [1] => 14.7 [2] => 15.01 [3] => 14.28 [4] => 16.87 [5] => 14.98 [6] => 13.02 [7] => 13.96 [8] => 15.67 [9] => 14.73 [10] => 15.45 [11] => 14.34 [12] => 14.78 [13] => 16.68 [14] => 15.01 [15] => 14.31)
)
Lo que quiero es que se obtengan los valores de las claves que contengan la cadena "Avg" y me devuelva sus valores, o de ser posible crear un nuevo array solo con los arreglos asociativos obtenidos.
He intentado con la función array_key_exists() en un if e imprimir un mensaje de si se encontraron los valores, pero me muestra que no se ha encontrado nada.
//Buscar claves que contengan "Avg" en el arreglo
if(array_key_exists('Avg', $valoresFinal)){
echo 'Claves encontradas';
}else{
echo 'claves no encontradas';
}
Lo que me gustaría obtener con esto es un arreglo parecido a este:
array(
[PTemp_C_Avg] => Array ( [0] => 7.261 [1] => 7.215 [2] => 7.218 [3] => 7.305 [4] => 7.499 [5] => 7.801 [6] => 8.21 [7] => 8.67 [8] => 9.17 [9] => 9.7 [10] => 10.28 [11] => 10.91 [12] => 11.57 [13] => 12.28 [14] => 13.09 [15] => 13.96),
[T0_10cm_Avg] => Array ( [0] => 21.32 [1] => 21.18 [2] => 21.07 [3] => 20.54 [4] => 20.61 [5] => 20.92 [6] => 20.16 [7] => 20.26 [8] => 20.39 [9] => 20.49 [10] => 20.05 [11] => 20.29 [12] => 20.7 [13] => 20.82 [14] => 20.27 [15] => 20.47),
)
¿Como podría conseguir esto?