我正在尝试根据 PHPIF
条件显示原始 HTML 表格,但它不起作用。
你能告诉我有什么问题吗?
此代码是 html 电子邮件的一部分。$heating
如果变量更大,我想显示原始数据0
。
PHP代码:
<table border=\"1\">
<tr>
<td>Rental, cleaning and Taxes</td>
<td align=right>$rent</td>
</tr>
<?php if ($heating > 0) ?>
<tr>
<td>Pool heating</td>
<td align=right>$heating</td>
</tr>
<?php endif; ?>
<tr>
<td>BBQ</td>
<td align=right>$bbq</td>
</tr>
<tr>
<td>Refundable Damage deposit</td>
<td align=right>250</td>
</tr>
<tr>
<td>Total(includes all taxes and fees</td>
<td align=right>$total</td>
</tr>
</table>
电子邮件显示:
Rental, cleaning and Taxes 1150
Pool heating 0
BBQ 50
Refundable Damage deposit 250
Total(includes all taxes and fees 1450