I'm a beginner in PHP, I'm trying to create a button, and according to whether I was clicking the next line of the file would be displayed.
1st click - line 1 is displayed / 2nd click - line 2 is displayed / and so on
<?php
$linhas = file("texto.txt");
for($i = 0;$i < count($linhas);$i++) {
echo "<button value='". $linhas[$i]. "'>". $linhas[$i] ."</button>";
}
?>
But in the code above, all the lines end up being buttons:
WhatIwouldliketoseehappen:Ifthecodeisreadingline5,itwilldisplayonlyline5.Ifthecodeisreadingline6,itwillonlydisplayline6.
MoreclearexampleofwhatI'mtryingtodo: