How can I read a text file in PHP and output each line sequentially?

To read a text file in PHP and output each line sequentially, you can use the `fgets()` function in a while loop to read each line of the file until the end is reached. You can then echo or print each line as it is read.

$file = fopen("example.txt", "r") or die("Unable to open file!");
while (!feof($file)) {
    echo fgets($file) . "<br>";
}
fclose($file);