X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/4a2873617dcbaf58ff6135aa7d8dcb115c0cc5ba..9025b0ec78bd770e74a1bed85c8d2e43ce5f571a:/lib-php/lib.php?ds=sidebyside diff --git a/lib-php/lib.php b/lib-php/lib.php index a1f528fa..8d82c5b3 100644 --- a/lib-php/lib.php +++ b/lib-php/lib.php @@ -227,3 +227,10 @@ function closestHouseNumber($aRow) return max(min($aRow['endnumber'], $iHn), $aRow['startnumber']); } + +if (!function_exists('array_key_last')) { + function array_key_last(array $array) + { + if (!empty($array)) return key(array_slice($array, -1, 1, true)); + } +}