|
Posted by Adam Cantrell on July 30, 2008, 2:54 pm
Please log in for more thread options
Thank you very much -
Adam Cantrell
show/hide quoted text
> Hi,
> You're correct, but you just need double quotes: "\n".
> In a single-quoted string, the only interpreted escape sequences are \
> \ and \'.
> Regards,
> John Peters
> > How could I count the number of newlines in a heredoc variable? This
> > outputs 0, but I thought heredoc preserved newlines?
> > <?
> > $test =3D <<<END
> > =A0 =A0 =A0 =A0 =A0 Hi There
> > END;
> > echo substr_count($test, '\n');
|
<p>