<?php
while($row = mysql_fetch_array($result))
echo "
<tr>
<td><b>".$row['extension']."</b></td>
<td>" . $row['curprefix'] . " " . ($row['msetupfee'] =='-1.00' ? 'N/D' : $row['msetupfee']) . "</td>
<td>" . $row['curprefix'] . " " . ($row['qsetupfee'] =='-1.00' ? 'N/D' : $row['qsetupfee']) . "</td>
<td>" . $row['curprefix'] . " " . ($row['ssetupfee'] =='-1.00' ? 'N/D' : $row['ssetupfee']) . "</td>
<td>" . $row['curprefix'] . " " . ($row['asetupfee'] =='-1.00' ? 'N/D' : $row['asetupfee']) . "</td>
<td>" . $row['curprefix'] . " " . ($row['bsetupfee'] =='-1.00' ? 'N/D' : $row['bsetupfee']) . "</td>
<td>" . $row['curprefix'] . " " . ($row['monthly'] =='-1.00' ? 'N/D' : $row['monthly']) . "</td>
<td>" . $row['curprefix'] . " " . ($row['quarterly'] =='-1.00' ? 'N/D' : $row['quarterly']) . "</td>
<td>" . $row['curprefix'] . " " . ($row['semiannually'] =='-1.00' ? 'N/D' : $row['semiannually']) . "</td>
<td>" . $row['curprefix'] . " " . ($row['annually'] =='-1.00' ? 'N/D' : $row['annually']) . "</td>
<td>" . $row['curprefix'] . " " . ($row['biennially'] =='-1.00' ? 'N/D' : $row['biennially']) . "</td>
</tr>
";
mysql_close($link);
?>
输出:
.pt € 14.70 € N/D € 40.00 € N/D € 61.00 € N/D € N/D € N/D € N/D € N/D
.com € 9.95 € 19.30 € 29.85 € N/D € 49.60 € N/D € N/D € N/D € N/D € 99.00
€N / D 必须显示 N / D
答案 0 :(得分:2)
只需在三元语句中移动货币符号。
"...." . "<td>" . ($row['msetupfee'] =='-1.00' ? 'N/D' : $row['curprefix'] . " " . $row['msetupfee']) . "</td>";