Re: displaying var in textarea
| From: | Ben Duffy | Date: | Fri, 10 Oct 2003 15:26:36 +0000 |
| Subject: | Re: displaying var in textarea | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165755@lists.php.net to get a copy of this message | ||
"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\\';';