I have this array which provides Geo-restriction information from API, this is an array list of countries where content is being BLOCKED :
Array ( [0] => GU [1] => PR [2] => CA [3] => VI [4] => US [5] => UM [6] => AS [7] => MP [8] => DE )
Now, I have another array which stores country-wise proxy information like this :
$proxies['US'] = 'my_us_proxy_url;
$proxies['DE'] = 'my_de_proxy_url;
$proxies['UK'] = 'my_uk_proxy_url;
$proxies['NL'] = 'my_nl_proxy_url;
I want to get value of the proxy which will allow user to bypass the country restriction i.e. a $proxies[KEY]
value where KEY
does not exist in the first array.
This is one of the snippet I tried but like everything else this is not the logic what is needed.
$isBlocked = array_values;
//print_r($isBlocked);
if (in_array('US',$isBlocked))
{
echo 'US Blocked';
foreach ($isBlocked as $value) {
if (!array_key_exists($value,$proxies)){
//Find first non blocked proxy and continue
echo "<br/>" . $value ;
}
}
}