Search code examples
phpgeoipmaxmind

I got unwanted digits in echo


I have used this code

$ip =  change_ipv4_ipv6($_SERVER['REMOTE_ADDR']);
$giasn = geoip_open("GeoIPASNumv6.dat", GEOIP_STANDARD);
$asn = geoip_name_by_addr_v6($giasn, $ip);
geoip_close($giasn);

after this code i echo record like this

echo 'Shell';

It gives result like this

1111111111111111111Shell

When i remove geopip code then it shows result like below

Shell

I want to get ride of these Ones. Any advice

thanks


Solution

  • It's likely that somewhere in one of those functions a 1 is being printed.

    Search for print/echo in the geoip functions, it's a stab in the dark, but I'd like to guess that it is echoing a boolean.

    When you said "When i remove geopip code then it shows result like belo"w

    This should give you a clue that the echo is coming from the geoip code, try commenting out the functions one by one to figure out which function is causing it.