我使用下面的代码,试图围捕的角度,这对整个作品,但数量小于0.5四舍五入为0.我想圆了每一个数字的下一个整数.例如,0.02应舍入为1
{{((data.Virtual.SumCores/data.Physical.SumCores) | number:0)*1}}
传入以下JSON字符串json_decode(),它正在返回NULL.
{"total_goals":26,"total_games":17,"average_goals":"1.53"}
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
$homeJSON = file_get_contents("http://strategy-bets.com/archive/archive.php?baseurl=http://www.totalcorner.com".$Home_Team_Link);
$homeJSON = str_replace("\xEF\xBB\xBF",'',$homeJSON);
$homeJSON = rtrim($homeJSON);
$homeJSON = html_entity_decode($homeJSON);
$homeJSON = preg_replace('/\s+/', '', $homeJSON);
$clean = rtrim($homeJSON, "\x00..\x1F");
$home_decoded = json_decode($clean);
Run Code Online (Sandbox Code Playgroud)
$home_decoded还在NULL.