/** * Returns the known country/region codes as an array. * * @return CArrayObject The known country/region codes of type `CUStringObject`. */ public static function knownCountryCodes() { return oop_a(CMap::keys(DULocale::$CountryCodeToInfo)); }
/** * Extracts and returns the keys from a map, as an array. * * @return CArrayObject The map's keys. */ public function keys() { return CArrayObject::fromSplArray(CMap::keys($this->m_map)); }
public function testKeys() { $map = ["one" => "a", "two" => "b", "three" => "c"]; $keys = CMap::keys($map); $this->assertTrue(CArray::equals($keys, CArray::fromElements("one", "two", "three"))); }