Alternative to money_format() Function in PHP on Windows Platform

前端 未结 13 1916
天命终不由人
天命终不由人 2020-12-01 09:02

I am using the money_format() function in PHP, which gives the following error:

Fatal error: Call to undefined function money_format()
         


        
13条回答
  •  [愿得一人]
    2020-12-01 09:50

    I always just used this to manually add the dollar sign:

    // for $k = 53.234234978
    $k = "$ " . number_format($k, 2);
    // output = $ 53.23
    

提交回复
热议问题