skip to Main Content

PHP – Limit and offset foreach loops

I am going to add limit and offset to this loop: <?php $images = get_field('am_c_gallery'); if( $images ): ?> <?php foreach( $images as $image ): ?> <div class="item-big"></div> <?php endforeach; ?> <?php endif; ?> How can I add offset 1…

VIEW QUESTION

foreach array_combine two array by php

There are two arrays that One is the correct answers and the other is the user's answer. My Php: $i=1; $correct = array('a','d','c','a','b','c'); $user = array('a','c','c','a','c','c'); foreach (array_combine($correct, $user) as $co => $ur) { if($co == $ur) { echo $i.':true…

VIEW QUESTION
Back To Top
Search