Well, this is the following, I'm generating paging links to get more lightness in my system, the problem is I have many records in the database and this pagination generates many links, thus occupying a very large part of the page, I would like to if it is possible to limit the for in the php so that it generates the links dynamically not taking up much space on page, or if there is a smarter way of improving my code, thanks
ThecodeIcurrentlyuseisthis
$qtdPag=receivestotalrecordsvaluedividedbyresultsperpage
$pg=receiveviaGETthecurrentpage
if($qtdPag>1&&$pg<=$qtdPag){for($i=1;$i<=$qtdPag;$i++){if($i==$pg){echo"<i>[".$i."]</i>";
} else {
echo "<i><a href='socios.php?pg=$i'>[".$i."]</a></i>";
}
}