php-general | 2005051

RE: [PHP] text with $ From: Mikey (frak <email protected>)
Date: 05/09/05

> > 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php