eXorithm – Execute Algorithm: View / Run Algorithm freebase_populations

Logo Beta

function freebase_populations ($countries
{
  $query = array'type'=>'/location/country'
                 'name'=>null, 
                 'query:name|='=>$countries
                 'iso3166_1_alpha2!='=>''
                 '/location/statistical_region/population'=> arrayarray
                   'limit'=>1,
                   'number'=>null,
                   'year'=>null,
                   'sort'=>'-year'
                 )) );
  
  $results = freebase_query$query);
  
  $return = array();
  foreach ($results as $result) {
    if (isset$result'/location/statistical_region/population'][0]['number'])) {
      $return$result'name']] = $result'/location/statistical_region/population'][0]['number'];
    }
  }
  return $return