X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/72b01148d2d12f71c12440c15fa078b55e1c8f86..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)); + } +}