(PHP 8)
enchant_dict_add — 將單字加入個人單字列表
dictionary
由 enchant_broker_request_dict() 或 enchant_broker_request_pwl_dict() 傳回的 Enchant 字典。
word
要加入的單字
版本 | 說明 |
---|---|
8.0.0 |
dictionary 參數現在需要一個 EnchantDictionary 實例;先前需要的是 資源。 |
範例 #1 新增單字到 PWL
<?php
$filename = './my_word_list.pwl';
$word = 'Supercalifragilisticexpialidocious';
$broker = enchant_broker_init();
$dict = enchant_broker_request_pwl_dict($broker, $filename);
enchant_dict_add($dict, $word);
enchant_broker_free($broker);
?>