php-general | 2005051
Date: 05/09/05
- Next message: Mark Rees: "RE: [PHP] Accessible HTML - OT"
- Previous message: Brent Baisley: "Re: [PHP] text with $"
- In reply to: Andy Pieters: "Re: [PHP] text with $"
- Next in thread: Victor Saldaņa D.: "Re: [PHP] text with $"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> > 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
- Next message: Mark Rees: "RE: [PHP] Accessible HTML - OT"
- Previous message: Brent Baisley: "Re: [PHP] text with $"
- In reply to: Andy Pieters: "Re: [PHP] text with $"
- Next in thread: Victor Saldaņa D.: "Re: [PHP] text with $"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

