I\'ve been using this exact same code for ages, and I have never had a single problem. Now all of a sudden it has stopped working.
I have read across the internet ab
i could just do the following and it will work perfect.
$numbers = 123456789;
$toThousands = number_format($numbers);
results will be: 123,456,789, the func "number_format" is already build in function.
I am running on ubuntu-16.04 and I am using php7, I had the same issue, It is because of the php_intl extension
the way I fixed it-
First check the extension is installed or not on your server, use below command to check it
php -m | grep intl
If there's no results, you must need to install it
If not installed, let's install it
sudo apt-get update
sudo apt-get install php-intl
Finally you need to restart your web server after you install
Class 'NumberFormatter' not found error in simple PHP program
https://www.howtoinstall.co/en/ubuntu/xenial/php-intl
Actually if you're using xampp and php > 7.*
edit the line ;extension=intl
to extension=intl
, restart mysql service and you're good to go.