(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL enchant >= 0.1.0 )
enchant_broker_request_dict — 使用標籤建立新的字典
使用標籤 `tag` 建立新的字典,`tag` 為您希望請求字典的非空語言標籤(例如 "en_US"、"de_DE" 等)。
成功時返回字典資源,失敗時返回 false
。
版本 | 說明 |
---|---|
8.0.0 |
broker 現在需要一個 EnchantBroker 實例;先前需要一個資源。 |
8.0.0 | 成功時,此函數現在返回一個 EnchantDictionary 實例;先前返回一個資源。 |
範例 #1 enchant_broker_request_dict() 範例
使用 enchant_broker_dict_exists() 檢查字典是否存在,然後請求它。
<?php
$tag = 'en_US';
$broker = enchant_broker_init();
if (enchant_broker_dict_exists($broker,$tag)) {
$dict = enchant_broker_request_dict($broker, $tag);
}
?>