本文整理匯總了PHP中CMap::keys方法的典型用法代碼示例。如果您正苦於以下問題:PHP CMap::keys方法的具體用法?PHP CMap::keys怎麽用?PHP CMap::keys使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CMap
的用法示例。
在下文中一共展示了CMap::keys方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: knownCountryCodes
/**
* 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));
}
示例2: keys
/**
* 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));
}
示例3: testKeys
public function testKeys()
{
$map = ["one" => "a", "two" => "b", "three" => "c"];
$keys = CMap::keys($map);
$this->assertTrue(CArray::equals($keys, CArray::fromElements("one", "two", "three")));
}