PHP Conference Japan 2024

enchant_dict_describe

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL enchant >= 0.1.0 )

enchant_dict_describe描述個別字典

說明

enchant_dict_describe(EnchantDictionary $dictionary): 陣列

返回字典的詳細資訊。

參數

dictionary

enchant_broker_request_dict()enchant_broker_request_pwl_dict() 返回的 Enchant 字典。

回傳值

成功時返回 true,失敗時返回 false

更新日誌

版本 說明
8.0.0 dictionary 參數現在需要一個 EnchantDictionary 實例;先前需要的是 資源
8.0.0 在此版本之前,函式失敗時會返回 false

範例

範例 #1 enchant_dict_describe() 範例

使用 enchant_broker_dict_exists() 檢查字典是否存在,並顯示其詳細資訊。

<?php
$tag
= 'en_US';
$broker = enchant_broker_init();
if (
enchant_broker_dict_exists($broker,$tag)) {
$dict = enchant_broker_request_dict($r, $tag);
$dict_details = enchant_dict_describe($dict);
print_r($dict_details);
}
?>

上述範例將輸出類似以下的內容

Array
(
    [lang] => en_US
    [name] => aspell
    [desc] => Aspell Provider
    [file] => /usr/lib/enchant/libenchant_aspell.so
)

新增註解

使用者貢獻的註解

此頁面沒有使用者貢獻的註解。
To Top