Check the first level of an array to verify all the values are numeric
<?php
if (!function_exists('array_contains_all_numeric_values')) {
/**
* Check the first level of an array to verify all the values are numeric
*
* @param array $array
* @return bool
*/
function array_contains_all_numeric_values(array $array)
{
if (count($array) === count(array_filter($array, 'is_numeric'))) {
return true;
}
return false;
}
}