How can PHP scripts handle line breaks in CSV files to avoid using all data for the first line?

When reading CSV files in PHP, line breaks can cause issues where all data is read into the first line of the file. To handle line breaks properly, you can use the `fgetcsv()` function with the `ini_set('auto_detect_line_endings', true)` to automatically detect line endings in the CSV file.

<?php
ini_set('auto_detect_line_endings', true);
$file = fopen('data.csv', 'r');
while (($data = fgetcsv($file)) !== false) {
    // Process each row of data here
    print_r($data);
}
fclose($file);
?>