public static function getCodesByNames($names=array())
	{
		if (!($gdb = self::getGeoDBO()))
		{
			return array();
		}

		$names = array_map('strtolower', $names);
		foreach ($names as $k => $name)
		{
			$names[$k] = $gdb->quote($name);
		}

		$gdb->setQuery("SELECT DISTINCT name, code FROM countries WHERE LOWER(name) IN (" . implode(",", $names) . ")");
		$values = $gdb->loadAssocList('name');
		if (!is_array($values))
		{
			$values = array();
		}
		return $values;
	}
public static function getCodesByNames($names=array())
	{
		if (!($gdb = self::getGeoDBO()))
		{
			return array();
		}

		$names = array_map('strtolower', $names);
		foreach ($names as $k => $name)
		{
			$names[$k] = $gdb->quote($name);
		}

		$gdb->setQuery("SELECT DISTINCT name, code FROM countries WHERE LOWER(name) IN (" . implode(",", $names) . ")");
		$values = $gdb->loadAssocList('name');
		if (!is_array($values))
		{
			$values = array();
		}
		return $values;
	}
public static function getCodesByNames ( $ names = array ( ) ) { if ( ! ( $ gdb = self :: getGeoDBO ( ) ) ) { return array ( ) ; } $ names = array_map ( 'strtolower' , $ names ) ; foreach ( $ names as $ k => $ name ) { $ names [ $ k ] = $ gdb -> quote ( $ name ) ; } $ gdb -> setQuery ( "SELECT DISTINCT name, code FROM countries WHERE LOWER(name) IN (" . implode ( "," , $ names ) . ")" ) ; $ values = $ gdb -> loadAssocList ( 'name' ) ; if ( ! is_array ( $ values ) ) { $ values = array ( ) ; } return $ values ; }
Get a list of country codes by names

@param   array  $names  List of country names
@return  array
Get a list of country codes by names