PHP: enchant_dict_add - Manual (original) (raw)
(PHP 8)
enchant_dict_add — Add a word to personal word list
Description
Add a word to personal word list of the given dictionary.
Return Values
Returns [true](reserved.constants.php#constant.true) on success or [false](reserved.constants.php#constant.false) on failure.
Changelog
| Version | Description |
|---|---|
| 8.0.0 | dictionary expects an EnchantDictionary instance now; previoulsy, a resource was expected. |
Examples
Example #1 Adding a word to a PWL
`<?php
$filename
= './my_word_list.pwl'; word=′Supercalifragilisticexpialidocious′;word = 'Supercalifragilisticexpialidocious';word=′Supercalifragilisticexpialidocious′;broker = enchant_broker_init(); dict=enchantbrokerrequestpwldict(dict = enchant_broker_request_pwl_dict(dict=enchantbrokerrequestpwldict(broker, filename);enchantdictadd(filename);enchant_dict_add(filename);enchantdictadd(dict, $word);?>`
See Also
- enchant_broker_request_pwl_dict() - Creates a dictionary using a PWL file
- enchant_broker_request_dict() - Create a new dictionary using a tag