{"id":22747149,"url":"https://github.com/cs-eliseev/helpers-word","last_synced_at":"2025-04-14T11:33:51.830Z","repository":{"id":56959766,"uuid":"165349025","full_name":"cs-eliseev/helpers-word","owner":"cs-eliseev","description":"The helpers allows you to modify string data. Inclination, transliterate, convert month date and convert number or amount to word - all this is available in this library.","archived":false,"fork":false,"pushed_at":"2019-04-28T09:09:19.000Z","size":52,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T00:44:57.866Z","etag":null,"topics":["collection","collections","cse","framework","helper","helpers","inclination","library","number2word","php","text","tool","tools","transliteration","utilities","utility","utils","word"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cs-eliseev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-12T05:08:34.000Z","updated_at":"2024-05-30T11:03:27.000Z","dependencies_parsed_at":"2022-08-21T09:50:45.996Z","dependency_job_id":null,"html_url":"https://github.com/cs-eliseev/helpers-word","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-eliseev%2Fhelpers-word","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-eliseev%2Fhelpers-word/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-eliseev%2Fhelpers-word/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs-eliseev%2Fhelpers-word/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cs-eliseev","download_url":"https://codeload.github.com/cs-eliseev/helpers-word/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248566769,"owners_count":21125717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collection","collections","cse","framework","helper","helpers","inclination","library","number2word","php","text","tool","tools","transliteration","utilities","utility","utils","word"],"created_at":"2024-12-11T03:13:24.689Z","updated_at":"2025-04-14T11:33:51.208Z","avatar_url":"https://github.com/cs-eliseev.png","language":"PHP","funding_links":["https://www.paypal.me/cseliseev/10usd"],"categories":[],"sub_categories":[],"readme":"English | [Русский](https://github.com/cs-eliseev/helpers-word/blob/master/README.ru_RU.md)\n\nWORD CSE HELPERS\n=======\n\n[![Travis (.org)](https://img.shields.io/travis/cs-eliseev/helpers-word.svg?style=flat-square)](https://travis-ci.org/cs-eliseev/helpers-word)\n[![Codecov](https://img.shields.io/codecov/c/github/cs-eliseev/helpers-word.svg?style=flat-square)](https://codecov.io/gh/cs-eliseev/helpers-word)\n[![Scrutinizer code quality](https://img.shields.io/scrutinizer/g/cs-eliseev/helpers-word.svg?style=flat-square)](https://scrutinizer-ci.com/g/cs-eliseev/helpers-word/?branch=master)\n\n[![Packagist](https://img.shields.io/packagist/v/cse/helpers-word.svg?style=flat-square)](https://packagist.org/packages/cse/helpers-word)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square)](https://packagist.org/packages/cse/helpers-word)\n[![Packagist](https://img.shields.io/packagist/l/cse/helpers-word.svg?style=flat-square)](https://github.com/cs-eliseev/helpers-word/blob/master/LICENSE.md)\n[![GitHub repo size](https://img.shields.io/github/repo-size/cs-eliseev/helpers-word.svg?style=flat-square)](https://github.com/cs-eliseev/helpers-word/archive/master.zip)\n\nThe helpers allows you to modify string data. Inclination, transliterate, convert month date and convert number or amount to word - all this is available in this library.\n\nProject repository: https://github.com/cs-eliseev/helpers-word\n\n**DEMO**\n```php\n$number = 21;\nWord::getInclinationByNumber(\n    $number,\n    ['котик', 'котика', 'котиков'],\n    'мурлычит ' . Word::convertUnsignedIntNumberToWord($number) . ' '\n);\n// мурлычит двадцать один котик\n```\n\n***\n\n## Introduction\n\n[CSE HELPERS](https://github.com/cs-eliseev/helpers/blob/master/README.md) is a collection of several libraries with simple functions written in PHP for people.\n\nDespite using PHP as the main programming language for the Internet, its functions are not enough. WORD CSE HELPERS solves the problem: word inclination, word transliteration, number or sum conversion to a word, etc.\n\n[CSE HELPERS](https://github.com/cs-eliseev/helpers/blob/master/README.md) was created for the rapid development of web applications.\n\n**CSE Helpers project:**\n* [Array CSE helpers](https://github.com/cs-eliseev/helpers-arrays)\n* [Cookie CSE helpers](https://github.com/cs-eliseev/helpers-cookie)\n* [Date CSE helpers](https://github.com/cs-eliseev/helpers-date)\n* [Email CSE helpers](https://github.com/cs-eliseev/helpers-email)\n* [IP CSE helpers](https://github.com/cs-eliseev/helpers-ip)\n* [Json CSE helpers](https://github.com/cs-eliseev/helpers-json)\n* [Math Converter CSE helpers](https://github.com/cs-eliseev/helpers-math-converter)\n* [Phone CSE helpers](https://github.com/cs-eliseev/helpers-phone)\n* [Request CSE helpers](https://github.com/cs-eliseev/helpers-request)\n* [Session CSE helpers](https://github.com/cs-eliseev/helpers-session)\n* [Word CSE helpers](https://github.com/cs-eliseev/helpers-word)\n\nBelow you will find some information on how to init library and perform common commands.\n\n## Install\n\nYou can find the most recent version of this project [here](https://github.com/cs-eliseev/helpers-word).\n\n### Composer\n\nExecute the following command to get the latest version of the package:\n```bash\ncomposer require cse/helpers-word\n```\n\nOr file composer.json should include the following contents:\n```json\n{\n    \"require\": {\n        \"cse/helpers-word\": \"*\"\n    }\n}\n```\n\n### Git\n\nClone this repository locally:\n```bash\ngit clone https://github.com/cs-eliseev/helpers-word.git\n```\n\n### Download\n\n[Download the latest release here](https://github.com/cs-eliseev/helpers-word/archive/master.zip).\n\n## Usage\n\nThe class consists of static methods that are conveniently used in any project. See example [examples-word.php](https://github.com/cs-eliseev/helpers-word/blob/master/examples/examples-word.php).\n\n**Convert string to UTF-8**\n\nExample default charset(CP1251):\n```php\n$text = mb_convert_encoding('привет', 'CP1251');\nWord::stringToUtf($text);\n// привет\n```\n\nSet charset:\n```php\n$text = mb_convert_encoding('привет', 'KOI8-R');\nWord::stringToUtf($text, 'KOI8-R');\n// привет\n```\n\n**Date month to word converter**\n\nExample:\n```php\nWord::convertDateMonthToWord('2019-01-01');\n// 01 января 2019\n```\n\nAdd delimiter to result:\n```php\nWord::convertDateMonthToWord('05.05.2018', '/');\n// 05/мая/2018\n```\n\n**Inclination**\n\nExample:\n```php\nWord::getInclinationByNumber(10, ['котик', 'котика', 'котиков']);\n// котиков\n```\n\nAdd number:\n```php\nWord::getInclinationByNumber(0, ['%d котик', '%d котика', '%d котиков']);\n// 0 котиков\n```\n\nAdd string number to text:\n```php\nWord::getInclinationByNumber('01', ['был %d котик', 'было %d котика', 'было %d котиков']);\n// был 1 котик\n```\n\nAdd text prefix:\n```php\n   Word::getInclinationByNumber(4, ['котик', 'котика', 'котиков'], 'еще %d ');\n// еще 4 котика\n```\n\n**Text transliterate**\n\nExample:\n```php\nWord::transliterate('12 пользователей online');\n// 12 polzovateley online\n```\n\n\n**Convert number to word**\n\nExample:\n```php\nWord::convertUnsignedIntNumberToWord(0);\n// ноль\nWord::convertUnsignedIntNumberToWord('1001');\n// одна тысяча один\n```\n\nChange ones inclination:\n```php\nWord::convertUnsignedIntNumberToWord(2002, 0);\n// две тысячи двe\n```\n\n**Convert amount to word**\n\nExample:\n```php\nWord::convertAmountToWord(0);\n// ноль рублей 0 копеек\n```\n\nCents example:\n```php\nWord::convertAmountToWord('1001.1');\n// одна тысяча один рубль 10 копеек\nWord::convertAmountToWord(2012.01);\n// две тысячи двенадцать рублей 01 копейка\n```\n\nCents to word example:\n```php\nWord::convertAmountToWord(87654.02, true, true);\n// восемьдесят семь тысяч шестьсот пятьдесят четыре рубля две копейки\n```\n\nIgnore zero cents:\n```php\nWord::convertAmountToWord('1098765.00', false);\n// один миллион девяносто восемь тысяч семьсот шестьдесят пять рублей\n```\n\n**CamelCase converter**\n\nExample:\n```php\nWord::camelCase('example-word');\n// ExampleWord\n```\n\nRevert CamelCase:\n```php\nWord::camelCase('ExampleWord', true);\n// example-word\n```\n\nChange delimiter:\n```php\nWord::camelCase('ExampleWord', true, '/');\n// example/word\n```\n\n\n## Testing \u0026 Code Coverage\n\nPHPUnit is used for unit testing. Unit tests ensure that class and methods does exactly what it is meant to do.\n\nGeneral PHPUnit documentation can be found at https://phpunit.de/documentation.html.\n\nTo run the PHPUnit unit tests, execute:\n```bash\nphpunit PATH/TO/PROJECT/tests/\n```\n\nIf you want code coverage reports, use the following:\n```bash\nphpunit --coverage-html ./report PATH/TO/PROJECT/tests/\n```\n\nUsed PHPUnit default config:\n```bash\nphpunit --configuration PATH/TO/PROJECT/phpunit.xml\n```\n\n\n## Donating\n\nYou can support this project [here](https://www.paypal.me/cseliseev/10usd). \nYou can also help out by contributing to the project, or reporting bugs. \nEven voicing your suggestions for features is great. Anything to help is much appreciated.\n\n\n## License\n\nThe WORD CSE HELPERS is open-source PHP library licensed under the MIT license. Please see [License File](https://github.com/cs-eliseev/helpers-word/blob/master/LICENSE.md) for more information.\n\n***\n\n\u003e GitHub [@cs-eliseev](https://github.com/cs-eliseev)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcs-eliseev%2Fhelpers-word","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcs-eliseev%2Fhelpers-word","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcs-eliseev%2Fhelpers-word/lists"}