有人可以帮我如何编码温度的差异。例如,在通道一中,差异应该是 3 。通道二应该是 10,通道三应该是 2。另外,如果我将温度改为负值。我应该如何编码?帮助
<?php
$a1=array(
"channelOne"=>"45",
"channelTwo"=>"100",
"channelThree"=>"20"
);
foreach($a1 as $Name=>$Temperature) {
echo "Channel_Name"."<br>".$Name."<br>"."Actual_Temperature"."<br>".$Temperature."<br>";
}
$a2=array(
"channelOne"=>"48",
"channelTwo"=>"90",
"channelThree"=>"22"
);
foreach($a2 as $Name=>$Temperature_Now) {
echo "Channel_Name"."<br>".$Name."<br>"."Temperature_Now"."<br>".$Temperature_Now."<br>";
}
?>