|
Posted by Darko on 04/02/07 12:52
On Apr 2, 2:08 pm, Mike Roetgers <miker...@informatik.uni-bremen.de>
wrote:
> and...@blueyonder.com schrieb:
>
>
>
> > If I set a varaible as
>
> > $EOL = "\r\n"
>
> > But then want to echo that to a HTML page to see the above string
> > i.e. \r\n
>
> > by doing: echo($EOL);
>
> > How do I do it?
>
> > I've tried quotemeta, addslashes and htmlspecialchar
> > but can't seem to work it out.
>
> > thanks
>
> > Andy
>
> It should work with single quotes:
> $EOL = '\r\n';
> echo $EOL;
>
> That should output:
> \r\n
and, of course, it should (and does) work as you've described - with
the combination of addslashes and htmlspecialchars, although it will
work fine with just addslashes, but it isn't formally correct. So you
should do echo htmlspecialchars(addslashes("\r\n"));
[Back to original message]
|