单击下一步,从.txt文件中读取和显示数据

I've researched this but the only answer I get is to display all the text, or line by line. How can I display data from text file in blocks.

lets say this is in a text file and I want to display this

display this when clicked next because there's a new line between the two lines.

I'm doing this because I have paragraphs and I don't want to display the lines that match the input, but every paragraph, displaying next block when clicked next

Well the fastest thing i could think of would be:

$file = file_get_contents('text.txt', true);

$preview= explode(PHP_EOL, $file);

echo $preview[0];
echo $preview[1];
echo $preview[2];
echo $preview[3];

As you already have the other part and didnt see the code, this may help