enchant_broker_list_dicts

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

enchant_broker_list_dicts返回可用字典列表

描述

enchant_broker_list_dicts(EnchantBroker $broker): array

返回一个包含可用字典及其详细信息的列表。

参数

broker

enchant_broker_init() 返回的 Enchant 代理。

返回值

返回一个包含可用字典及其详细信息的 array

变更日志

版本 描述
8.0.0 broker 现在期望一个 EnchantBroker 实例;以前,期望一个 resource
8.0.0 在此版本之前,函数在失败时返回 false

示例

示例 #1 列出某个代理的所有可用字典

<?php
$r
= enchant_broker_init();
$dicts = enchant_broker_list_dicts($r);
print_r($dicts);
?>

上面的例子将输出类似于

Array
(
    [0] => Array
        (
            [lang_tag] => de
            [provider_name] => aspell
            [provider_desc] => Aspell Provider
            [provider_file] => /usr/lib/enchant/libenchant_aspell.so
        )

    [1] => Array
        (
            [lang_tag] => de_DE
            [provider_name] => aspell
            [provider_desc] => Aspell Provider
            [provider_file] => /usr/lib/enchant/libenchant_aspell.so
        )

    [3] => Array
        (
            [lang_tag] => en
            [provider_name] => aspell
            [provider_desc] => Aspell Provider
            [provider_file] => /usr/lib/enchant/libenchant_aspell.so
        )

    [4] => Array
        (
            [lang_tag] => en_GB
            [provider_name] => aspell
            [provider_desc] => Aspell Provider
            [provider_file] => /usr/lib/enchant/libenchant_aspell.so
        )

    [5] => Array
        (
            [lang_tag] => en_US
            [provider_name] => aspell
            [provider_desc] => Aspell Provider
            [provider_file] => /usr/lib/enchant/libenchant_aspell.so
        )

    [6] => Array
        (
            [lang_tag] => hi_IN
            [provider_name] => myspell
            [provider_desc] => Myspell Provider
            [provider_file] => /usr/lib/enchant/libenchant_myspell.so
        )

)

参见

添加说明

用户贡献的说明

此页面没有用户贡献的说明。
To Top