因为免费额度获取的问题,在PHP5.3上报错 但获取到的应该是一个字符串,所以出错,应该这样改: function price_format($price, $change_price = true) { $price = 0 + $price;//添加这一行,转换成数值