Zo4inec
2/15/2017 - 12:16 PM

Вывод массива в 2 колонках

Вывод массива в 2 колонках

<?php if(!$comments) { echo "no comments"; } ?>
		<?php $round = round(count($comments) / 2);
		$disjoint = array_chunk($comments, $round);
		?>
		<?php foreach ($disjoint as $array) { ?>
			<div class="col-md-6">
		<?php foreach ($array as $comment) { ?>
			<div class="faq-trigger">
				<span><?php echo $comment['name']; ?><i class="arrow-down"></i></span>
				<div class="faq-text"><?php echo $comment['text']; ?></div>
			</div>
		<?php } ?>
			</div>
		<?php } ?>