1 回答
TA贡献1877条经验 获得超1个赞
通常如果你的$prod不为空,这应该有效:
<?php
$aux = count($prods);
?>
<html>
<body>
<?php
foreach($prods as $key => $value){
if($aux%2 == 0){ ?>
<div class="container">
<div class="row justify-content-around my-3">
<figure class="col-6 figure my-3 row justify-content-center">
<img style="height: 20vw" src="imagenes/d3.jpeg" class="figure-img img-fluid rounded" alt="...">
</figure>
<div class="col-6 row justify-content-around">
<div class="col row align-items-center">
<div class="col display-3"><?php $value ?></div>
<div class="col-12 display-5">Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam saepe ipsum quod nesciunt labore magni a perspiciatis sunt officia facere, reprehenderit praesentium explicabo ipsa eligendi! Cumque nulla reiciendis perferendis sequi.</div>
<p class="col-12 lead">Precio: Lorem, ipsum dolor.</p>
</div>
</div>
</div>
</div>
<?php $aux = $aux-1; } else {?>
<div class="container">
<div class="row justify-content-around my-3">
<div class="col-6 row justify-content-around">
<div class="col row align-items-center">
<div class="col-12 display-3"><?php $value ?></div>
<div class="col-12 display-5">Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam saepe ipsum quod nesciunt labore magni a perspiciatis sunt officia facere, reprehenderit praesentium explicabo ipsa eligendi! Cumque nulla reiciendis perferendis sequi.</div>
<p class="col-12 lead">Precio: Lorem, ipsum dolor.</p>
</div>
</div>
<figure class="col-6 figure my-3 row justify-content-center">
<img style="height: 20vw" src="imagenes/d.jpeg" class="figure-img img-fluid rounded" alt="...">
</figure>
</div>
</div>
<?php $aux = $aux-1; ?>
<?php }};?>
</body>
</html>
- 1 回答
- 0 关注
- 97 浏览
添加回答
举报