Warning: number_format() expects parameter 1 to be double, string given in

来源:互联网 发布:淘宝店铺起名字 编辑:程序博客网 时间:2024/06/05 05:19
因为免费额度获取的问题,在PHP5.3上报错
但获取到的应该是一个字符串,所以出错,应该这样改:
function price_format($price, $change_price = true)
{
    $price = 0 + $price;//添加这一行,转换成数值
1 0
原创粉丝点击