1 回答

TA貢獻1846條經驗 獲得超7個贊
你試過嗎?您的代碼可以這樣編寫:ob_startob_get_clean
<?php // assuming php open here...
ob_start(); ?>
<div class="quick-view-list nav">
<?php
// do your conditional operator here....
?>
<a class="active" href="<?php echo $similarProduct0; ?>">
<img src="<?php echo $similarProductImg0; ?>" alt="Similar Product" width="100px" height="112px">
</a>
<a href="<?php echo $similarProduct1; ?>">
<img src="<?php echo $similarProductImg1; ?>" alt="Similar Product" width="100px" height="112px">
</a>
<a href="<?php echo $similarProduct2; ?>">
<img src="<?php echo $similarProductImg2; ?>" alt="Similar Product" width="100px" height="112px">
</a>
</div>
<?php
echo ob_get_clean();
- 1 回答
- 0 關注
- 113 瀏覽
添加回答
舉報