Use double quotes (") when you want PHP to interpret special characters like \n as newlines. Use single quotes (') when you want the string to be taken literally without any special character interpretation.
// Using double quotes>
echo "This is a line\nAnd this is another line";
// Using single quotes
echo 'This is a line\nAnd this is another line';
Output:
This is a line
And this is another line
This is a line\nAnd this is another line
No comments:
Post a Comment