<?php
// Reformatted code and displayed the numbers, please make necessary changes to make this work with your requirements.
$i = 1;
$images = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];
var_dump($images);
$modRe = 0;
$current_index = 0;
for ($x = 0; $x <= 5; $x++) { // this for loop is for creating 5 slides
if($i % 3 == 0){
$CssClass = 'three_slide';
$mode = 3;
}
else if($i % 3 == 1){
$CssClass = ' 2 two_slide';
$mode = 2;
}
else if($i % 3 == 2){
$CssClass = ' 3 three_slide_flip';
$mode = 3;
}
?>
<div class="arch-slider-item <?php echo $CssClass; ?>">
<?php
var_dump('Index I = '.$i); // Check the i looping value
var_dump('Mode = '.$mode); // Check the mode - having how much images in this slide
$limit = $current_index+$mode;
for($index = $current_index; $index < $limit; $index++) {
if(isset($images[$index])) {
echo $images[$index]; // Replace code here with your, having single slide and multiple images
}
$current_index++;
}
echo "<br>"; // Break the slide
?>
</div>
<?php
$i++;
}