From 6fa5e55b0556b437e6960f527cb9da003c7ef25c Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Fri, 27 Sep 2019 07:54:57 -0700 Subject: [PATCH] Update change log and README.md for getWithPrefixLen --- CHANGELOG.md | 3 +++ README.md | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bccce1..612b9f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ CHANGELOG * PHP 5.6 or greater is now required. * The C extension now supports PHP 8. Pull request by John Boehr. GitHub #87. +* A new method, `getWithPrefixLen`, was added to the `Reader` class. + This method returns an array containing the record and the prefix + length for that record. GitHub #89. 1.4.1 (2019-01-04) ------------------ diff --git a/README.md b/README.md index f1597c4..a132fa2 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,13 @@ $databaseFile = 'GeoIP2-City.mmdb'; $reader = new Reader($databaseFile); +// get returns just the record for the IP address print_r($reader->get($ipAddress)); +// getWithPrefixLen returns an array containing the record and the +// associated prefix length for that record. +print_r($reader->getWithPrefixLen($ipAddress)); + $reader->close(); ```