What considerations should be made regarding line breaks and carriage returns when processing text files in PHP?

When processing text files in PHP, it is important to consider the different line break characters used on different operating systems (e.g., "\n" for Unix/Linux, "\r\n" for Windows). To ensure consistent handling of line breaks, you can use PHP's built-in functions like `file()` or `fgets()` to read the file line by line and then use `trim()` to remove any extra whitespace, including carriage returns and line breaks.

$file = fopen("example.txt", "r");

while(!feof($file)) {
    $line = trim(fgets($file));
    // Process the line here
}

fclose($file);