How can the provided PHP code be modified to handle data without keys, as shown in the example text file?

The issue with the provided PHP code is that it assumes the data in the text file has keys for each value, but the example text file contains data without keys. To handle data without keys, we can modify the code to read the lines from the text file and store them in an array without assigning keys. This way, we can access the values using numerical indexes.

<?php
// Read data from the text file into an array without keys
$data = file("example.txt", FILE_IGNORE_NEW_LINES);

// Loop through the array to access the values
foreach ($data as $line) {
    echo $line . "<br>";
}
?>