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 关注
- 136 浏览
添加回答
举报
