What function is used to read a line from a file in PHP, and what are its limitations?

To read a line from a file in PHP, you can use the `fgets()` function. However, it is important to note that `fgets()` reads the file line by line, so it may not be suitable for reading large files as it can consume a lot of memory. If you need to read a large file, consider using `fread()` instead.

// Open the file for reading
$handle = fopen("example.txt", "r");

// Read and output each line from the file
while(!feof($handle)){
    $line = fgets($handle);
    echo $line;
}

// Close the file
fclose($handle);