...
$size = count($cart2);
$x = 0;
while ($x < $size) {
echo
'
<div class="card p-3 col-12 col-md-6 col-lg-3">
<div class="card-wrapper media-container-row media-container-row">
<div class="card-box">
<p class="mbr-text mbr-fonts-style display-7">'.$cart2[$x]['title'].'<br></p>
<h3 class="mbr-section-subtitle mbr-fonts-style display-4"><a href="popup:#mbr-popup-e" class="text-black" data-toggle="modal" data-target="#mbr-popup-e">УСЛОВИЯ</a></h3>
</div>
</div>
</div>
';
$x++;
}