To test this sample file from other locations, check out this list of web-based online proxy servers.
Free Sample PHP Code
include 'callingcode.inc'; $acceptLanguage = $_SERVER['HTTP_ACCEPT_LANGUAGE']; $pattern = '/-' // Delimiter '/' and '-' preceding country code . '(AD|AE|(?#RegExLib.com)|ZM|ZW)' // Regular Expression matching ISO 3166 Country Codes . '(?(?=.*q=)(?=.*(q=0\.[7-9]|q=1))|.*)' // Country code must be of a quality value q=0.7 or higher . '/'; // Delimiter '/' if ( preg_match( $pattern, $acceptLanguage, $matches ) ) $callingcode = getCountryCallingCode( $matches[1] ); // [1] for first parenthesized subpattern