What are some best practices for handling line breaks in log files in PHP?

When handling line breaks in log files in PHP, it's important to ensure that the log entries are formatted correctly for readability and consistency. One common approach is to use PHP's built-in `PHP_EOL` constant to insert line breaks in log entries. This ensures that the logs are properly formatted regardless of the operating system.

$logMessage = "Log entry message" . PHP_EOL;
file_put_contents('logfile.txt', $logMessage, FILE_APPEND);