I would like your help on a problem.
The results of the pagination function properly only to the 7th page
From page 1 to 7 and everything works fine. After the 7th page numbers disappear and appear only previous - next
if(count($list['pages']) >= 7) {
$founded = false;
for($i = 1; $i <= count($list['pages']); $i++) {
if($list['pages'][$i]['active'] != 1) {
$founded = $i;
break;
}
}
for($i = 1; $i <= count($list['pages']); $i++) {
if($i == 1 && $founded > $i + 2) {
$html .= '<li><span>…</span></li>';
}
if($i == count($list['pages']) && $founded < $i - 2) {
$html .= '<li><span>…</span></li>';
}
if($i >= $founded - 2 && $i <= $founded + 2) {
$html .= '<li>'.$list['pages'][$i]['data'].'</li>';
}
}
} else {
for($i = 1; $i <= count($list['pages']); $i++) {
$html .= '<li>'.$list['pages'][$i]['data'].'</li>';
}
}(
for($i = 1; $i <= count($list['pages']); $i++) {
$html .= '<li>'.$list['pages'][$i]['data'].'</li>';
}
