How can you differentiate between different types of line breaks (e.g., \r, \n, \r\n) when processing CSV files in PHP?

When processing CSV files in PHP, it's important to be able to differentiate between different types of line breaks (\r, \n, \r\n) to ensure proper parsing of the data. One way to handle this is by using the PHP function `ini_set('auto_detect_line_endings', true);` before reading the CSV file. This will automatically detect the line endings and handle them accordingly.

// Set auto_detect_line_endings to true
ini_set('auto_detect_line_endings', true);

// Open the CSV file for reading
$file = fopen('example.csv', 'r');

// Loop through each line in the CSV file
while (($line = fgetcsv($file)) !== false) {
    // Process each line of the CSV file
    print_r($line);
}

// Close the CSV file
fclose($file);