RE: text with $

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux