add alternative array_key_first for older verisons of PHP

This commit is contained in:
FusionPBX
2021-01-04 18:31:44 -07:00
committed by GitHub
parent b7c5d29e39
commit 8d46b4f299

View File

@@ -2194,4 +2194,14 @@ function number_pad($number,$n) {
}
}
?>
//add alternative array_key_first for older verisons of PHP
if (!function_exists('array_key_first')) {
function array_key_first(array $arr) {
foreach($arr as $key => $unused) {
return $key;
}
return NULL;
}
}
?>