Changing blocks based on visitor's country
Your code seems to be right. You've mis-spelled the module name in the module_invoke function at #3 and misplaced the semicolon ;

Try this:

&lt;?php

$detectedcountry = module_invoke('ip2country','get_country',$_SERVER['REMOTE_ADDR']);
$us_canada = array(
  'US','CA'
);

//return true in block visibility when the country appears to be in detected country
if(in_array($detectedcountry,$us_canada)){
  return true;
} 

?&gt;