RE: [PHP] text with $
| From: | Mikey | Date: | Mon, 09 May 2005 15:28:03 +0000 |
| Subject: | RE: [PHP] text with $ | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-214784@lists.php.net to get a copy of this message | ||
> > I have a text variable that contains "$" symbols, that when
> I pass it
> > out PHP thinks that the "$" mean that a variable name comes
> right after.
> >
> To include the string symbol in a variable, use the single quotes.
>
> $myvar='this is $$$ test';
Or, if you still want to use interpolation, use the backslash to escape the
$:
$str = "\$foo = $bar";
HTH,
Mikey