How to Convert Digit to Words in Php Laravel Using Php Built in NumberFormatter Class
· ☕ 1 min read · ✍️ shibu
NumberFormatter We can convert number to string using php built in class NumberFormatter .
1 2 3 4 <?php $digit = new NumberFormatter("en", NumberFormatter::SPELLOUT); echo $digit->format(264); // output will be "two hundred sixty-four" Troubleshooting: You need to enable php_intl extension, when using NumberFormatter class. You can enable this from php.ini setting file.
In my case, I am using ubuntu server. I required to install php7.