A very useful and simple function if you are to create a PHP site should be the amount of output is not only an integer, but also in words (for example, when printing invoices online), then this function is simply irreplaceable.
Just add this feature at the end of the ruble / ruble / rubles (in the right declination).
An example of the script:
Of the 53423 translates into "Fifty-three thousand four hundred twenty-three ruble".
Of the 310 translates into "Three hundred and ten rubles."
Of the 21 transfers in "twenty-one rubles".
Of the 1000021 translates to "one million twenty-one rubles".
PHP script is debugged and fully working. It was created for a large online store.
For a long time we are looking for a ready script, but did not find anything decent. As a result, you write your own.
PHP-function code is very simple and intuitive. You can make changes.
It is not difficult to translate into any other language.