What is the method to output a line break in PHP echo?
In PHP, you can use “\n” or “” to output a line break.
- use the character “\n”
- “First line\nSecond line\nThird line”
- Output result:
- First line
Second line
Third line - Use quotation marks.
- echo “First line
Second line
Third line”; - Output:
Line one
Line two
Line three