【发布时间】:2014-07-08 20:16:31
【问题描述】:
我想在 echo 中放置一个 if 语句,但我不太确定该怎么做。这是回声:
if(!$hideProduct) {
echo '
<div class="gearBorder">
<img title="Sold Out" alt="Sold Out" class="soldOut" src="soldout.png" />':"").'
<div class="gearInfo">
<h4>' . $productName . '</h4>
<p class="gearDesc">'. $productDescription .'</p>
<p class="cost">$' . $productPrice . '</div>
</div>
</div>
';}
在第 3 行,我想将图像包装在 if 语句中:
if($productStatus = '0') {
}
在该语句中包装图像的最佳方式是什么?谢谢!
【问题讨论】:
标签: if-statement echo