Best Practices: working with long, multiline strings in PHP?
<p>Note: I'm sorry if this is an extremely simple question but I'm somewhat obsessive compulsive over the formatting of my code.</p>

<p>I have a class that has a function that returns a string that will make up the body text of an email. I want this text formatted so it looks right in the email, but also so it doesn't make my code look funky. Here's what I mean:</p>

<pre><code>class Something
{
    public function getEmailText($vars)
    {
        $text = 'Hello ' . $vars-&gt;name . ",

The second line starts two lines below.

I also don't want any spaces before the new line, so it's butted up against the left side of the screen.";
        return $text;
    }
}
</code></pre>

<p>but it could also be written as:</p>

<pre><code>public function getEmailText($vars)
{
    $text = "Hello {$vars-&gt;name},\n\rThe second line starts two lines below.\n\rI also don't want any spaces before the new line, so it's butted up against the left side of the screen.";
    return $text;
}
</code></pre>

<p>but what's the deal with new lines and carriage returns? What's the difference? Is <code>\n\n</code> the equivalent of <code>\r\r</code> or <code>\n\r</code>? Which should I use when I'm creating a line gap between lines?</p>

<p>Then there's the option of output buffering and heredoc syntax.</p>

<p>How do you deal with using long multiline strings in your objects?</p>
