public static function ip2locationRecord( $record ) {
		if ( isset( $record['error'] ) ) {
			throw new \Exception( $record['error'] );
		}

		self::$geot_record                                   = [];
		self::$geot_record['city']['names']                  = isset( $record['cityName'] ) ? [ 'en' => $record['cityName'] ] : '';
		self::$geot_record['city']['zip']                    = isset( $record['zipCode'] ) ? $record['zipCode'] : '';
		self::$geot_record['continent']['names']             = '';
		self::$geot_record['continent']['iso_code']          = '';
		self::$geot_record['country']['iso_code']            = isset( $record['countryCode'] ) ? $record['countryCode'] : '';
		self::$geot_record['country']['names']               = isset( $record['countryName'] ) ? [ 'en' => $record['countryName'] ] : '';
		self::$geot_record['state']['iso_code']              = '';
		self::$geot_record['state']['names']                 = isset( $record['regionName'] ) ? [ 'en' => $record['regionName'] ] : '';
		self::$geot_record['geolocation']['latitude']        = $record['latitude'] ?: '';
		self::$geot_record['geolocation']['longitude']       = $record['longitude'] ?: '';
		self::$geot_record['geolocation']['accuracy_radius'] = $record['accuracyRadius'] ?: '';
		self::$geot_record['geolocation']['time_zone']       = $record['timeZone'] ?: '';

		return json_decode( json_encode( self::$geot_record ) );
	}
public static function ip2locationRecord( $record ) {
		if ( isset( $record['error'] ) ) {
			throw new \Exception( $record['error'] );
		}

		self::$geot_record                                   = [];
		self::$geot_record['city']['names']                  = isset( $record['cityName'] ) ? [ 'en' => $record['cityName'] ] : '';
		self::$geot_record['city']['zip']                    = isset( $record['zipCode'] ) ? $record['zipCode'] : '';
		self::$geot_record['continent']['names']             = '';
		self::$geot_record['continent']['iso_code']          = '';
		self::$geot_record['country']['iso_code']            = isset( $record['countryCode'] ) ? $record['countryCode'] : '';
		self::$geot_record['country']['names']               = isset( $record['countryName'] ) ? [ 'en' => $record['countryName'] ] : '';
		self::$geot_record['state']['iso_code']              = '';
		self::$geot_record['state']['names']                 = isset( $record['regionName'] ) ? [ 'en' => $record['regionName'] ] : '';
		self::$geot_record['geolocation']['latitude']        = $record['latitude'] ?: '';
		self::$geot_record['geolocation']['longitude']       = $record['longitude'] ?: '';
		self::$geot_record['geolocation']['accuracy_radius'] = $record['accuracyRadius'] ?: '';
		self::$geot_record['geolocation']['time_zone']       = $record['timeZone'] ?: '';

		return json_decode( json_encode( self::$geot_record ) );
	}
public static function ip2locationRecord ( $ record ) { if ( isset ( $ record [ 'error' ] ) ) { throw new \ Exception ( $ record [ 'error' ] ) ; } self :: $ geot_record = [ ] ; self :: $ geot_record [ 'city' ] [ 'names' ] = isset ( $ record [ 'cityName' ] ) ? [ 'en' => $ record [ 'cityName' ] ] : '' ; self :: $ geot_record [ 'city' ] [ 'zip' ] = isset ( $ record [ 'zipCode' ] ) ? $ record [ 'zipCode' ] : '' ; self :: $ geot_record [ 'continent' ] [ 'names' ] = '' ; self :: $ geot_record [ 'continent' ] [ 'iso_code' ] = '' ; self :: $ geot_record [ 'country' ] [ 'iso_code' ] = isset ( $ record [ 'countryCode' ] ) ? $ record [ 'countryCode' ] : '' ; self :: $ geot_record [ 'country' ] [ 'names' ] = isset ( $ record [ 'countryName' ] ) ? [ 'en' => $ record [ 'countryName' ] ] : '' ; self :: $ geot_record [ 'state' ] [ 'iso_code' ] = '' ; self :: $ geot_record [ 'state' ] [ 'names' ] = isset ( $ record [ 'regionName' ] ) ? [ 'en' => $ record [ 'regionName' ] ] : '' ; self :: $ geot_record [ 'geolocation' ] [ 'latitude' ] = $ record [ 'latitude' ] ? : '' ; self :: $ geot_record [ 'geolocation' ] [ 'longitude' ] = $ record [ 'longitude' ] ? : '' ; self :: $ geot_record [ 'geolocation' ] [ 'accuracy_radius' ] = $ record [ 'accuracyRadius' ] ? : '' ; self :: $ geot_record [ 'geolocation' ] [ 'time_zone' ] = $ record [ 'timeZone' ] ? : '' ; return json_decode ( json_encode ( self :: $ geot_record ) ) ; }
Normalize Ip2location to match our api Results

@param $record

@return string
@throws \Exception
Normalize Ip2location to match our api Results