PHP new line not showing in text

Note to self whenever you are experiencing problems with rendering new lines in php e.g. using \n you must wrap these in double quotes not single e.g.

This will NOT work

echo ='My line with a line feed \n';

This WILL work

echo ="My line with a line feed \n";
Bookmark and Share

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)