Re: displaying var in textarea
| From: | Ben Duffy | Date: | Fri, 10 Oct 2003 15:32:58 +0000 |
| Subject: | Re: displaying var in textarea | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165756@lists.php.net to get a copy of this message | ||
"Ben Duffy" <duffy_ben@hotmail.com> wrote in message
news:20031010152628.44545.qmail@pb1.pair.com...
>
> "Shawn McKenzie" <nospam@mckenzies.net> wrote in message
> news:20031010152321.37202.qmail@pb1.pair.com...
> > I have a var:
> > $test = 'echo \'test\';';
> >
> > If I display this in a textearea like so:
> > echo "<textarea wrap=\"virtual\" rows=\"20\"
> > style=\"width: 100%\"
> > name=\"action\">\n"
> > .$test
> > ."</textarea>\n";
> >
> > In the browser and in the HTML source I see (no slashes):
> > echo 'test';
> >
> > Even if I do an htmlentities($test); I see no slashes and the
> single-quotes
> > are not shown in the HTML source as "
> >
> > Is this just a behavior of the textarea???
> >
> > Thanks!
> > -Shawn
>
> Shawn,
>
> try $test = 'echo \\'test\\';';
Apologies,
try
$test = 'echo \\\'test\\\';';
escaping the slash itself, and escaping the comma..