'PHP script only works in Chrome

I have a code that works fine in Chrome browser but refuses to work in other browsers.

I would be glad for any advice on how to make it work not only for Chrome and what could be my mistake.

<?php
$geoplugin = unserialize( file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $_SERVER['REMOTE_ADDR']) );
if ( is_numeric($geoplugin['geoplugin_latitude']) && is_numeric($geoplugin['geoplugin_longitude']) && !is_user_logged_in() ) {
    $lat = $geoplugin['geoplugin_latitude'];
    $long = $geoplugin['geoplugin_longitude'];
if ($geoplugin['geoplugin_countryCode'] == 'US') {
    echo '<a href="#" class="btn btn-info">Title</a>';
}
}
?>


Solution 1:[1]

After a long clarification of the reasons why the code does not work, it turned out that the whole problem was in incorrect server caching.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bob Nowak