HonkBlog|TechNotes

Notes, fixes, tips and suggestions from across my technical world

PHP new line not showing in text

 PHP  No Responses »
Nov 232009
 

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";
 Posted by Simon at 10:47 am  Tagged with: formatting, linefeed, notetoself, PHP

Tags

.htaccess 1.2 Active Server Pages adjacency list model advice anatomy annoyances ASP Cake PHP Coldfusion connect defragment doh dynamic evernote facebook fbml feed formatting fql frenchconnections howto ideas IIS Internet Information Services languages Learning Curve life hacking linefeed logout mptt msoffice mysites notetoself notworking PHP Quickstart robots.txt rss snagit tips Transition video whitespace xml

Recent comments

  • Akula D on Windows 7: PID 4 listening to port 8 – Apache cannot start
  • sanoop on Windows 7: PID 4 listening to port 8 – Apache cannot start
  • George on How to restore a corrupt MetaBase.xml
  • top eleven free tokens on How to link a Facebook app to a fan page
  • How to use the “__n()” for internationalisation/i18n function in cakephp? » HonkBlog|TechNotes on What does “__n()” do in cakephp?

My Tweets

Twitter