我困住了一個問題。如果條件內部的PHP變量
我在PHP變量裏面有HTML元素。現在我想如果條件內的HTML元素。
我的代碼是這樣的。
<?php
$x = 1;
$html =
'<style>
b
{
paading:0;
margin:0;
}
</style>
<table width="790px" style="font-family:Open Sans;">
<!--Want If Condition Here-->
if($x != 1)
{
<tr>
<td colspan="2">
My Separate Portion
</td>
</tr>
}
<strong></strong>
<tr> <td colspan="2"> <hr style="background-color:#E44510; height:10px;"> </td> </tr>';
echo $html;
?>
如果任何人都可以幫助我,它非常適合。
'$字符串= '富'。 ($ condition?'if true':'if false')。 '酒吧';'。 – h2ooooooo