What are common methods for creating line breaks in PHP strings?

To create line breaks in PHP strings, you can use the "\n" escape sequence or the PHP_EOL constant. These methods will insert a new line character into the string, causing the text to break to a new line when displayed. This is useful for formatting output or creating multiline strings in PHP.

// Using the "\n" escape sequence
$string1 = "This is line 1.\nThis is line 2.";

// Using the PHP_EOL constant
$string2 = "This is line 1." . PHP_EOL . "This is line 2.";