PHP - Manual: enchant_dict_describe
2024-12-22
(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL enchant >= 0.1.0 )
enchant_dict_describe — Describes an individual dictionary
Returns the details of the dictionary.
dictionary
An Enchant dictionary returned by enchant_broker_request_dict() or enchant_broker_request_pwl_dict().
成功时返回 true
, 或者在失败时返回 false
。
版本 | 说明 |
---|---|
8.0.0 |
dictionary expects an EnchantDictionary instance now;
previoulsy, a 资源(resource) was expected.
|
8.0.0 |
Prior to this version, the function returned false on failure.
|
示例 #1 A enchant_dict_describe() example
Check if a dictionary exists using enchant_broker_dict_exists() and show the detail of it.
<?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 )
官方地址:https://www.php.net/manual/en/function.enchant-dict-describe.php