$gtz="select * from add_to_cart where user_id='$userid'";
$gz1=mysql_query($gtz);
while($gz2=mysql_fetch_array($gz1))
{
$tprcz[]=$gz2['total_price'];
}
$fullquantityz=array_sum($tqtyz);
$tprcz[] 返回浮点值(例如 2.00 和 4.00 )。但是当找到总和时 $fullquantityz 返回值作为整数而不是浮点数,即 2.00 + 4.00 = 6 ,我希望将值打印为 2.00 + 4.00 = 6.00