0
4

1 回答 1

0

如果您不能使用JSON_NUMERIC_CHECK(因为它需要 PHP 5.3.3 ( json.constants ))

您可以投射int [ $number = (int)"1234";]

while ($r = mysql_fetch_array($sth)) {
    $rows['data'][] = (int)$r['revenue']; // <- (int)
}

while ($rr = mysql_fetch_assoc($sth)) {
    $rows1['data'][] = (int)$rr['overhead']; // <- (int)
}

print json_encode($result);
于 2013-07-03T16:17:18.657 回答