Note: I\'m sorry if this is an extremely simple question but I\'m somewhat obsessive compulsive over the formatting of my code.
I have a class that has a function th
Adding \n and/or \r in the middle of the string, and having a very long line of code, like in second example, doesn't feel right : when you read the code, you don't see the result, and you have to scroll.
In this kind of situations, I always use Heredoc (Or Nowdoc, if using PHP >= 5.3) : easy to write, easy to read, no need for super-long lines, ...
For instance :
$var = 'World';
$str = <<
Just one thing : the end marker (and the ';' after it) must be the only thing on its line : no space/tab before or after !