Vinzenz: Email Ausrichtung

Beitrag lesen

Hallo Dimde

Richtige Erklärung.

P.S. Ich wüsste gern, wieso das so ist und wie man das "umgehen" kann.
Um den Vorteil der ' (schneller, " müssen nicht escaped werden) zu
nutzen und trotzdem schönen Sourcecode auszugeben, müsste man ja
ständig sowas schreiben 'irgendein langer (Quell)Text'."\n";

Verwende ein heredoc (ab PHP 4)
http://www.php.net/manual/de/language.types.string.php#language.types.string.syntax.heredoc

Ich zitiere (etwas frei) aus Programming PHP von Rasmus Lerdorf & Kevin Tatroe:

<cite>
Quoting String Constants

There are three ways to write a literal string in your program:
  using single quotes,
  double quotes,
  and the here document (heredoc) ...
These methods differ in whether they recognize special escape sequences that
let you encode other characters or interpolate variables.

The general rule is to use the least powerful quoting mechanism necessary.
</cite>

Gruss,

Vinzenz