Fatal error: Class 'NumberFormatter' not found

前端 未结 15 839
误落风尘
误落风尘 2020-12-28 13:08

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

相关标签:
15条回答
  • 2020-12-28 13:43

    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.

    0 讨论(0)
  • 2020-12-28 13:44

    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

    0 讨论(0)
  • 2020-12-28 13:45

    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.

    0 讨论(0)
提交回复
热议问题