Re: escaping HTML
| From: | Michael Dearman | Date: | Mon, 11 Dec 2000 14:44:58 +0000 |
| Subject: | Re: escaping HTML | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29682@lists.php.net to get a copy of this message | ||
Toby Butzon wrote:
>
> You're not having problems escaping quotes... you're having problems because
> there's no command to tell PHP what to do with those lines of HTML code...
> you need some echos in there if you're going to enclose the whole thing in
> <?php ?>. ...but then the <? print ... ?> commands won't work like they used
> to, and you'll need to change those to be concatenated on to the HTML
> strings... ie:
>
> echo "<input type=\"text\" name=\"whatever\" value\"" .
> $value . "\">";
>
I swear I've gotten rid of the concat for vars and it works. Or am I nuts?
print "<input type=\"text\" name=\"whatever\"
value=\"$value\">";
This won't work for at least multi-dim arrays, but with PHP4 I 've just been using
{}'s.
...value=\"{array['this']['that']}\"....
Regular arrays I just do it out of habit now.
And {$$varvar} works in a string too.
but any function, yea, definitley still have to concat into the string.
This look reasonable, or am I missing something.
Mike D.