I'm trying to show my news block with bootstrap4 as
<div class="col-md-3">
<div class="card mb-4">
<a href="$arItem["DETAIL_PAGE_URL"]"><img src="$arItem["DETAIL_PICTURE"]["SRC"]"</a>
</div>
<div class="card mb-4">
<a href="$arItem["DETAIL_PAGE_URL"]"><img src="$arItem["DETAIL_PICTURE"]["SRC"]"</a>
</div>
</div>
<div class="col-md-3">
<div class="card mb-4">
<a href="$arItem["DETAIL_PAGE_URL"]"><img src="$arItem["DETAIL_PICTURE"]["SRC"]"</a>
</div>
<div class="card mb-4">
<a href="$arItem["DETAIL_PAGE_URL"]"><img src="$arItem["DETAIL_PICTURE"]["SRC"]"</a>
</div>
</div>
<div class="col-md-6">
<div class="card mb-big">
<a href="$arItem["DETAIL_PAGE_URL"]"><img src="$arItem["DETAIL_PICTURE"]["SRC"]"</a>
</div>
</div>
I have an array with results of database query in
$arResult["ITEMS"]
I want to do this with loop by
<? foreach ($arResult["ITEMS"] as $arItem): ?>
<?endforeach?>
I know i need to use something like
$i=0
if (i===2){
} else if ($k === 4) {
} else {}
$i++;
but how can i remove col-md-3 from loop.
<?php
$i=0
foreach ($arResult["ITEMS"] as $arItem): ?>
<div class="col-md-3">
<div class="card mb-4"></div>
</div>
if (i===2){
<div class="col-md-3">
<div class="card mb-4"></div>
</div>
}
if (i===4){
<div class="col-md-6">
<div class="card mb-4"></div>
</div>
}
I'm afraid I'm a little confused. How to show it in one loop?

<code>" "I know i need to use something like...<code>" - That appears to be pseudo code. If that isn't, then you have parse errors and undefined constants. You should also show us a diagram of what you're getting now, just like the one you posted for what you want it to look like.