for ($i = ($pagcurrent >= 5 ? $pagcurrent - 4 : $pagcurrent); $i <= ($paglast < $pagcurrent + 4 ? $paglast : $pagcurrent + 4); $i++) {
if ($i == $pagcurrent) {
echo "<li class='current'>" . $i . "</li>";
}
else {
echo "<li><a href='?page=" . $i . "&searchPlayername=" . $searchPlayername . "&searchSteamid=" . $searchSteamid . "&searchServer=" . $searchServer . "'>" . $i . "</a></li>";
}
}
So, this is basically what I have managed to do so far, but I was concerned whether i was skipping pages and whether the page with the "current" class is not actually the real page, idk, just concerned a bit, and since Im not very good at loops, i wanted someone to check if the code is good or not, and any suggestions if you have.