I have a variable $ pages that brings the amount of pages.
Then I need to create a li for each page, eg:
$paginas = 3;
sairia o resultado:
<li>1</li>
<li>2</li>
<li>3</li>
I have a variable $ pages that brings the amount of pages.
Then I need to create a li for each page, eg:
$paginas = 3;
sairia o resultado:
<li>1</li>
<li>2</li>
<li>3</li>
You can create a repeat loop for
, while the counter is less than the number of pages one, li
is printed with the value, I started the counter at 1 for the start list also start at number 1.
$paginas = 3;
for($i = 1; $i <= $paginas; $i++){
echo "<li>$i</li>";
}