你们昨天很有帮助。不过我仍然有点困惑。
我想把右侧栏的数字四舍五入到最接近的整数美元。
将此翻译成中文:http://www.nextadvisor.com/voip_services/voip_calculator.php?monthlybill=50&Submit=Submit http://www.nextadvisor.com/voip_services/voip_calculator.php?monthlybill=50&Submit=Submit
这个表格的代码看起来像这样:
我想将$offer[1,2,3,4,5,6,7]calcsavingsann四舍五入,我该怎么做?
<table width="100%;" border="0" cellspacing="0" cellpadding="0"class="credit_table2" >
<tr class="credit_table2_brd">
<td class="credit_table2_brd_lbl" width="100px;">Services:</td>
<td class="credit_table2_brd_lbl" width="120px;">Our Ratings:</td>
<td class="credit_table2_brd_lbl" width="155px;">Monthly VoIP Bill:</td>
<td class="credit_table2_brd_lbl" width="155px;">Annual Savings:</td>
</tr>
<?php
$offer1price="24.99";
$offer2price="20.00";
$offer3price="21.95";
$offer4price="23.95";
$offer5price="19.95";
$offer6price="23.97";
$offer7price="24.99";
$offer1calcsavings= $monthlybill - $offer1price;
$offer2calcsavings= $monthlybill - $offer2price;
$offer3calcsavings= $monthlybill - $offer3price;
$offer4calcsavings= $monthlybill - $offer4price;
$offer5calcsavings= $monthlybill - $offer5price;
$offer6calcsavings= $monthlybill - $offer6price;
$offer7calcsavings= $monthlybill - $offer7price;
$monthybill="monthlybill";
$offer1calcsavingsann= $offer1calcsavings * 12;
$offer2calcsavingsann= $offer2calcsavings * 12;
$offer3calcsavingsann= $offer3calcsavings * 12;
$offer4calcsavingsann= $offer4calcsavings * 12;
$offer5calcsavingsann= $offer5calcsavings * 12;
$offer6calcsavingsann= $offer6calcsavings * 12;
$offer7calcsavingsann= $offer7calcsavings * 12;
$re=1;
$offer = offer .$re. name ;
$offername= ${$offer};
while($offername!=""){
$offerlo = offer .$re. logo ;
$offerlogo=${$offerlo};
$offerli = offer .$re. link ;
$offerlink=${$offerli};
$offeran = offer .$re. anchor ;
$offeranchor=${$offeran};
$offerst = offer .$re. star1 ;
$offerstar=${$offerst};
$offerbot= offer .$re. bottomline ;
$offerbottomline=${$offerbot};
$offerca = offer .$re. calcsavings ;
$offercalcsavings=${$offerca};
$offerpr = offer .$re. price ;
$offerprice=${$offerpr};
$offersavann = offer .$re. calcsavingsann ;
$offercalcsavingsann=${$offersavann};
echo <tr >
<td >
<a href=" .$offerlink. " target="blank"><img src="http://www.nextadvisor.com .$offerlogo. " alt=" .$offername. " />
</a>
</td>
<td ><span class="rating_text">Rating:</span>
<span class="star_rating1">
<img src="http://www.nextadvisor.com .$offerstar. " alt="" />
</span>
<br />
<div style="margin-top:5px; color:#0000FF;">
<a href=" .$offerlink. " target="blank">Go to Site</a>
<span style="margin:0px 7px 0px 7px;">|</span><a href=" .$offeranchor. ">Review</a>
</div> </td>
<td >$ .$offerprice. </td>
<td >$ .$offercalcsavingsann. </td>
</tr> ;
$re=$re+1;
$offer = offer .$re. name ;
$offername= ${$offer};
}
?>
</table>