Functions returning NULL
-
Hello,
I dont understand if Im missing something or there’s a problem with APIs.
Using HostIP.info Web-API.
I can’t see any useful info and your examples return NULL.This
$userInfo = geoip_detect2_get_info_from_current_ip(); var_dump($userInfo);
Returns
object(YellowTree\GeoipDetect\DataSources\City)#12111 (13) { ["extra":protected]=> object(YellowTree\GeoipDetect\DataSources\ExtraInformation)#12124 (2) { ["validAttributes":protected]=> array(6) { [0]=> string(6) "source" [1]=> string(6) "cached" [2]=> string(5) "error" [3]=> string(8) "original" [4]=> string(4) "flag" [5]=> string(3) "tel" } ["record":"GeoIp2\Record\AbstractRecord":private]=> array(3) { ["source"]=> string(8) "hostinfo" ["cached"]=> int(1579888209) ["error"]=> string(0) "" } } ["city":protected]=> object(GeoIp2\Record\City)#12122 (3) { ["validAttributes":protected]=> array(3) { [0]=> string(10) "confidence" [1]=> string(9) "geonameId" [2]=> string(5) "names" } ["locales":"GeoIp2\Record\AbstractPlaceRecord":private]=> array(2) { [0]=> string(2) "it" [1]=> string(2) "en" } ["record":"GeoIp2\Record\AbstractRecord":private]=> array(0) { } } ["location":protected]=> object(GeoIp2\Record\Location)#12119 (2) { ["validAttributes":protected]=> array(9) { [0]=> string(13) "averageIncome" [1]=> string(14) "accuracyRadius" [2]=> string(8) "latitude" [3]=> string(9) "longitude" [4]=> string(9) "metroCode" [5]=> string(17) "populationDensity" [6]=> string(10) "postalCode" [7]=> string(16) "postalConfidence" [8]=> string(8) "timeZone" } ["record":"GeoIp2\Record\AbstractRecord":private]=> array(1) { ["time_zone"]=> NULL } } ["postal":protected]=> object(GeoIp2\Record\Postal)#12123 (2) { ["validAttributes":protected]=> array(2) { [0]=> string(4) "code" [1]=> string(10) "confidence" } ["record":"GeoIp2\Record\AbstractRecord":private]=> array(0) { } } ["subdivisions":protected]=> array(0) { } ["continent":protected]=> object(GeoIp2\Record\Continent)#12112 (3) { ["validAttributes":protected]=> array(3) { [0]=> string(4) "code" [1]=> string(9) "geonameId" [2]=> string(5) "names" } ["locales":"GeoIp2\Record\AbstractPlaceRecord":private]=> array(2) { [0]=> string(2) "it" [1]=> string(2) "en" } ["record":"GeoIp2\Record\AbstractRecord":private]=> array(0) { } } ["country":protected]=> object(GeoIp2\Record\Country)#12113 (3) { ["validAttributes":protected]=> array(5) { [0]=> string(10) "confidence" [1]=> string(9) "geonameId" [2]=> string(17) "isInEuropeanUnion" [3]=> string(7) "isoCode" [4]=> string(5) "names" } ["locales":"GeoIp2\Record\AbstractPlaceRecord":private]=> array(2) { [0]=> string(2) "it" [1]=> string(2) "en" } ["record":"GeoIp2\Record\AbstractRecord":private]=> array(0) { } } ["locales":protected]=> array(2) { [0]=> string(2) "it" [1]=> string(2) "en" } ["maxmind":protected]=> object(GeoIp2\Record\MaxMind)#12117 (2) { ["validAttributes":protected]=> array(1) { [0]=> string(16) "queriesRemaining" } ["record":"GeoIp2\Record\AbstractRecord":private]=> array(0) { } } ["registeredCountry":protected]=> object(GeoIp2\Record\Country)#511 (3) { ["validAttributes":protected]=> array(5) { [0]=> string(10) "confidence" [1]=> string(9) "geonameId" [2]=> string(17) "isInEuropeanUnion" [3]=> string(7) "isoCode" [4]=> string(5) "names" } ["locales":"GeoIp2\Record\AbstractPlaceRecord":private]=> array(2) { [0]=> string(2) "it" [1]=> string(2) "en" } ["record":"GeoIp2\Record\AbstractRecord":private]=> array(0) { } } ["representedCountry":protected]=> object(GeoIp2\Record\RepresentedCountry)#12120 (3) { ["validAttributes":protected]=> array(6) { [0]=> string(10) "confidence" [1]=> string(9) "geonameId" [2]=> string(17) "isInEuropeanUnion" [3]=> string(7) "isoCode" [4]=> string(5) "names" [5]=> string(4) "type" } ["locales":"GeoIp2\Record\AbstractPlaceRecord":private]=> array(2) { [0]=> string(2) "it" [1]=> string(2) "en" } ["record":"GeoIp2\Record\AbstractRecord":private]=> array(0) { } } ["traits":protected]=> object(GeoIp2\Record\Traits)#12121 (2) { ["validAttributes":protected]=> array(16) { [0]=> string(22) "autonomousSystemNumber" [1]=> string(28) "autonomousSystemOrganization" [2]=> string(14) "connectionType" [3]=> string(6) "domain" [4]=> string(9) "ipAddress" [5]=> string(11) "isAnonymous" [6]=> string(16) "isAnonymousProxy" [7]=> string(14) "isAnonymousVpn" [8]=> string(17) "isHostingProvider" [9]=> string(17) "isLegitimateProxy" [10]=> string(3) "isp" [11]=> string(13) "isPublicProxy" [12]=> string(19) "isSatelliteProvider" [13]=> string(13) "isTorExitNode" [14]=> string(12) "organization" [15]=> string(8) "userType" } ["record":"GeoIp2\Record\AbstractRecord":private]=> array(1) { ["ip_address"]=> string(13) "87.16.xxx.xxx" } } ["raw":protected]=> array(4) { ["traits"]=> array(1) { ["ip_address"]=> string(13) "87.16.xxx.xxx" } ["is_empty"]=> bool(true) ["extra"]=> array(3) { ["source"]=> string(8) "hostinfo" ["cached"]=> int(1579888209) ["error"]=> string(0) "" } ["location"]=> array(1) { ["time_zone"]=> NULL } } }
How am I supposed to get the country name (in english is fine), from this??
Thank you!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Functions returning NULL’ is closed to new replies.